How to configure line length for VS Code python Sort Imports in user settings?

Viewed 2282

I'm using the Sort Imports function of the Python extension for VS Code. I'd like to configure the line length for this to 100; however, I've been unable to properly set this in my settings.json file. From the documentation, it seems like "python.sortImports.args": ["-l", "100"] should work, but it's giving me an error: Invalid patch string: Skipped 1 files.

Any ideas?

1 Answers

There is a known bug with using Sort Imports on __init__.py files. Here is the full solution to put in vscode's .vscode/settings.json:

"python.sortImports.args": ["-ns", "__init__.py", "-l", "100"],
Related