-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Organize imports conflicts with Black formatting #6933
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
Comments
I think I know whats happening, not easy to replicate. At this stage I'd say we'd need a decision on what needs to be done. |
@cmcarey Ideally the solution is to use just one and not two. At the end of the day I've left this issue open so we can decide whether such a configuration is supported (using sort imports and a formatter together). |
I see, thank you. I use
As to being easy to replicate, if you copy the short example I used, it should demonstrate the issue (I've verified myself on a few different machines using vscode-python + latest black). |
Are your isort setting consistent with black? There are a specific set of black settings that don't conflict |
I had this issue but updated the |
A copy-and-paste-able version of @max-sixty's workaround: "python.sortImports.args": [
"--multi-line=3",
"--trailing-comma",
"--force-grid-wrap=0",
"--use-parentheses",
"--line-width=88",
] (add this to the EDIT: Changed to the exact arguments suggested in Black's docs |
Closing in favour of microsoft/vscode#83586. |
Environment data
1.37.0
2019.8.29288
Windows 10 Enterprise, 10.0.17763 Build 17763
3.7.4
Poetry/venv
black: 19.3-beta.0
Language server
Expected behaviour
Saving a file should not toggle between black-formatted and isort-formatted.
Actual behaviour
Saving a file once results in black-formatted, then saving it again results in isort-formatted, saving that results in black-formatted, and so on.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: