File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,4 +74,28 @@ IDE-specific Black integration guides:
7474
7575* [ VSCode: Using Black to automatically format Python] ( https://dev.to/adamlombard/how-to-use-the-black-python-code-formatter-in-vscode-3lo0 )
7676
77- Imports should be sorted with [ usort] ( https://usort.readthedocs.io/en/stable/ ) .
77+ ### Sort imports on Save
78+
79+ VS Code includes "isort" by default.
80+
81+ Add the following to user's ` settings.json ` :
82+
83+ ``` json
84+ "[python]" : {
85+ "editor.codeActionsOnSave" : {
86+ "source.organizeImports" : true
87+ }
88+ },
89+ "python.sortImports.args" : [
90+ " --trailing-comma" ,
91+ " --use-parentheses" ,
92+ " --line-width" ,
93+ " 88" ,
94+ " --multi-line" ,
95+ " 3" ,
96+ " --float-to-top"
97+ ],
98+ ```
99+
100+ All isort command line options can be found [ here] ( https://pycqa.github.io/isort/docs/configuration/options.html ) .
101+
You can’t perform that action at this time.
0 commit comments