-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Breaks Dockerfile #176
Comments
You can provide the complete dockerfile. |
have same problem |
Looks like this is bug in shfmt that is officially not supporting Dockerfiles mvdan/sh#640 |
I've just installed this extension and it's true that the automatic formatting of Dockerfiles that contain multiline RUN statements leads to broken Dockerfiles. If shfmt doesn't explicitly support Dockerfiles, perhaps disabling Dockerfile formatting is the right thing to do? Or at least provide optional configuration? |
The solution is probably provided in this comment: #29 (comment) |
To save some time for everyone arriving here, just add the following to your
I am not sure why both "do only |
@mcnesium, better configure a different formatter for Dockerfiles. This one works great. "[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-docker"
} But your effect langauges is good. Because disable formatOnSave is not respected by this extension for some reason. |
Yes, this worked for me, not the foxmoon one, that was removing my backslashes. In order for it work, I first had to go to https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker an install this extension. Only then
on the line
stopped being yellow underlined and worked fine when saving & formatting my dockerfile. Also please remember that you have to use the following naming |
Having a Dockerfile with the following instruction:
this extension formats this code block to removing
\
Which will lead to the following error:
Error response from daemon: dockerfile parse error line 17: unknown instruction: APK
Update
Prettier
and reloaded VS-Code but the Dockerfile kept getting formattedshell-format
and the Dockerfile stopped being formatted.The text was updated successfully, but these errors were encountered: