-
-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/shfmt: support editorconfig language sections
That is, support `[[shell]]` EditorConfig sections when formatting any shell file, and `[[bash]]` when formatting Bash files. This is mainly helpful when formatting files with a shebang but no extension, as then the formatter does use the right language when parsing and formatting the code, but EditorConfig doesn't kick in as it only knows how to match by filename per the spec. This feature is out of the EditorConfig spec, and upstream is tracking a feature like this at editorconfig/editorconfig#404 since 2019. Due to the lack of progress upstream, and how useful this feature is for shfmt, go ahead and add it ourselves, with a note that we may change or remove it at any time. Fixes #664.
- Loading branch information
Showing
5 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters