When using VS Code and flake8, line width of python code is by default limited to 79 characters.
For people like me, 79 characters are not enough. How can we increase it?
Open VS Code's settings page, and search flake8.args
, press Add Item
and input the following content:
--max-line-length=120
Then the limit will be 120 characters.
If you prefer to edit json file directly, use this:
{
"flake8.args": [
"--max-line-length=120"
]
}
python.linting.flake8Args
was used in the past and now you should use flake8.args
instead.
According to Migration to Python Tools Extensions, the VS Code team migrated flake8 realted stuff to an extension. This migration caused the changes of flake8 related configuration keys.