Skip to content

Commit

Permalink
cmd/shfmt: remove SHFMT_NO_EDITORCONFIG
Browse files Browse the repository at this point in the history
In late 2019, I wrote:

	We've also added an undocumented SHFMT_NO_EDITORCONFIG environment
	variable, which can be set to "true" to completely disable the feature
	in case it breaks badly when first released. This flag will be removed
	once the feature has been released and stable for a few months.

The rollout of editorconfig support went well enough,
so I don't recall suggesting that any uesrs rely on this fallback.

To my surprise and concern, not only did I forget to remove support for
the environment variable after "a few months",
but quite a few users still use it to this day in 2023.

Remove its support, printing a warning so users are aware.
This time add a TODO as a reminder for proper deletion.
  • Loading branch information
mvdan committed Mar 20, 2023
1 parent 1e04c5b commit 822b795
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/shfmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ For more information, see 'man shfmt' and https://github.com/mvdan/sh.
if minify.val {
simplify.val = true
}
// TODO(mvdan): remove sometime in 2024.
if os.Getenv("SHFMT_NO_EDITORCONFIG") == "true" {
useEditorConfig = false
fmt.Fprintln(os.Stderr, "SHFMT_NO_EDITORCONFIG was always undocumented; use any parser or printer flag to disable editorconfig support")
}
flag.Visit(func(f *flag.Flag) {
switch f.Name {
Expand Down

0 comments on commit 822b795

Please sign in to comment.