Skip to content

Commit 8f0dfbb

Browse files
committed
Added isort config
1 parent 65df91f commit 8f0dfbb

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff 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+

0 commit comments

Comments
 (0)