-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running format breaks Dockerfiles #29
Comments
can you paste your dockerfile content? |
@foxundermoon It seems Dockerfile is actually not supported by shfmt officially. |
foxundermoon/vs-shell-format#29 foxundermoon/vs-shell-format#62 mvdan/sh#424 The foxundermoon/vs-shell-format extension formats Dockerfiles, but it shouldn't, because the underlying formatter mvdan/sh isn't engineered for Dockerfiles. As explained in mvdan/sh#424, > Removing the `\` is correct in shell, because a line ending in `&&` > just continues the command in the following line. This commit will disable Dockerfile formatting.
foxundermoon/vs-shell-format#29 foxundermoon/vs-shell-format#62 mvdan/sh#424 The foxundermoon/vs-shell-format extension formats Dockerfiles, but it shouldn't, because the underlying formatter mvdan/sh isn't engineered for Dockerfiles. As explained in mvdan/sh#424, > Removing the `\` is correct in shell, because a line ending in `&&` > just continues the command in the following line. This commit will disable Dockerfile formatting.
@foxundermoon Please consider reopening and addressing this issue. When this extension is installed, format-on-save breaks Dockerfiles containing any backslashes (see mvdan/sh#424 as mentioned by @JounQin). |
@mattt |
If this formatter doesn't support Dockerfiles, why is it formatting Dockerfiles? |
Same issue here, this breaks my dockerfiles. It is very problematic that this extensions causes this and that the issue is not resolved yet. |
When running format on Dockerfiles it removes all of the
\
and line endings. This causes RUN commands in docker build to not work.Runnning shell-format 4.0.4 and shfmt 2.6.3
The text was updated successfully, but these errors were encountered: