Skip to content
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

Formatting in container on save #277

Closed
GwendalFernet opened this issue Jul 26, 2023 · 3 comments
Closed

Formatting in container on save #277

GwendalFernet opened this issue Jul 26, 2023 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.

Comments

@GwendalFernet
Copy link

GwendalFernet commented Jul 26, 2023

Hello, I have followed the guide for the installation and updated my settings.json. When I run VSCode in a container, my files aren't format on save. When I use Ctrl+P it says there is multiples formatters for python files, and when I choose black it format my code without issues. Hower there is no logs when I save without using Ctrl+P format document.

If I use a virtualenv and use it on my local machine instead of the docker container, the files are formatted correctly.

If I black with the python extension it works even in the container

@github-actions github-actions bot added the triage-needed Issue is not triaged. label Jul 26, 2023
@karthiknadig karthiknadig self-assigned this Jul 26, 2023
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Jul 26, 2023
@karthiknadig
Copy link
Member

@GwendalFernet Can you verify if these settings were present in the Container settings?

  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter",
    "editor.formatOnSave": true
  }

image

image

If those settings are added correctly it should work.

@GwendalFernet
Copy link
Author

@karthiknadig Ok it works thanks. It may be an issue with some other settings because it also works if I remove the file of the container. What's the difference between this settings and the settings on the .vscode folder?

@karthiknadig
Copy link
Member

The one in container overrides the User settings, and the one in .vscode folder in your workspace overrides any container, user or machine level settings.

@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

2 participants