
[!Note]
This is a fork of foxundermoon/vs-shell-format.
Since the original package no longer maintained, I just try to fork this package, fix this issue and re-publish new package to marketplace.
See https://github.com/foxundermoon/vs-shell-format/issues/396.
Get it on the VS Code Marketplace!
Enjoy shellscript!
Supported file types or languages
[!Note]
Dockerfile support is opt-in. It is registered as a language but excluded from the default shellformat.effectLanguages, so it won't format on save unless you enable it.
The upstream tool shfmt does not officially support Dockerfile. However, the common Dockerfile syntax (e.g. RUN with shell commands) falls within the shell grammar, in this case, shfmt can format Dockerfille. Because this is not an officially supported path and may mangle complex multiline constructs, it is disabled by default — enable it only if it works for your use case.
To enable, add dockerfile to shellformat.effectLanguages, or enable shellformat.useEditorConfig and add the following to your .editorconfig:
[Dockerfile]
indent_size = 4
indent_style = space
binary_next_line = true
See #14 for background.
| language |
extension |
describe |
| shellscript |
.sh .bash |
shell script files |
| dockerfile |
Dockerfile *.dockerfile |
dockerfile (opt-in) |
| ignore |
.gitignore .dockerignore |
ignore files |
| properties |
.properties |
java properties files |
| jvmoptions |
.vmoptions , jvm.options |
jvm options file |
| hosts |
/etc/hosts |
hosts file |
| bats |
.bats |
Bats test file |
| zsh |
.zsh .zshrc .zshenv |
zsh script files |

Usage
shift+option+f
shift+command+p then type Format Document
Dependencies
Custom configuration
shellformat.path the shfmt fullpath example [mac,linux]: /usr/local/bin/shfmt [windows]: C:\\bin\\shfmt.exe
shellformat.flag shfmt -h to see detailed usage.
Links
Contributors of the original project
Code Contributors
This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors
Become a financial contributor and help us sustain our community. [Contribute]
Individuals

Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
