Vscode is not formatting my code on save.
My vscode versions are thus:
- Vscode 1.37.0 (updated it as part of bug shooting, not sure previous version, but this didn't work either)
- autopep8 1.4.4 (pycodestyle: 2.5.0)
My settings.json look like this:
{
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"python.formatting.autopep8Args": [
"--max-line-length=120"
],
"python.formatting.provider": "autopep8",
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.pep8Args": [
"--max-line-length=120"
],
"python.linting.pep8Enabled": true,
"python.linting.pylintEnabled": false,
"python.pythonPath": "/home/me/.python_virtualenvs/somepath"
}
Why is autoformatting on save not working?
Additional notes:
- This correctly formatted my file:
python -m autopep8 --max-line-length 120 --in-place --aggressive --aggressive my_dirty_code.py
- I can see
Formatting with autopep8
in the taskbar on save