.vscode/settings.json
{
"python.linting.pylintEnabled": false,
"python.linting.enabled": true,
"python.linting.pylintArgs": [
"-d",
"C0301"
],
"python.testing.unittestArgs": [
"-v",
"-s",
".",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
// "python.formatting.provider": "none",
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": [
"--max-line-length",
"79",
"--experimental"
]
}
code:
if (1 == 10192310928301928301928301928301923 and rx_resp == 'aosidjaoisdjaoisdjaoisjdaoisjdaoisjdaoisjd' and 44 == 11111):
print('aoisjdoaijsdoiajsdoaisjdoaijsdoaisjdoaisjdaoisjdiasjdoajaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
No error shown on these long lines. When I click on format I should see some error saying line too long or linter should automatically break lines into shorter format.
2
Answers
settings.json
I uninstalled pylint extension.
Now some basic formatting works. eg:
status =status.HTTP_200_OK
after formatting will becomestatus=status.HTTP_200_OK
Install
Black Formatter
extension.set
.vscode/settings.json
file as follows:Now long lines in python will get reformatted on save.