Environment data
VS Code version: 1.36.0
Extension version (available under the Extensions sidebar): 2019.6.22090
OS and version: macOS, Mojave 10.14.5
Python version (& distribution if applicable, e.g. Anaconda): Python 2.7.16
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Relevant/affected Python packages and their versions:
autopep8 1.4.4
pycodestyle: 2.5.0
Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977 ): Jedi Enabled is "checked" (so, True?)
Expected behaviour
When I run "Format Document", the file is formatted.
Actual behaviour
When I run "Format Document", the file is not formatted.
Steps to reproduce:
Open a Workspace
Open up a Python File in the Workspace
Right Click -> Format Document
Current Settings:
User Settings (showing only Python related settings):
{
.
.
.
"workbench.statusBar.visible": true,
"files.autoSave": "afterDelay",
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnSaveTimeout": 1500,
"python.pythonPath": "/usr/local/bin/python",
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Path": "/usr/local/lib/python2.7/site-packages/autopep8.py",
"python.formatting.autopep8Args": [
"--max-line-length",
"70",
"--aggressive",
"--aggressive",
"--in-place"
],
"python.linting.pylintArgs": [
"--init-hook='import sys; sys.path.append(\"/Users/bagursreenivasamurth/OneDrive - F5 Networks/dev/godev/src/gitswarm.f5net.com/proj/tests/libs\")'"
]
}
Workspace Settings:
{
"folders": [
{
"path": "."
},
{
"path": "godev"
}
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
}
}
Extensions:
What I have already tried:
Ensured autopep8 is installed correctly to py2.7 : pip2 install --upgrade autopep8
The interpreter seems to be correctly pointing to py2.7 too
This works:
/usr/local/lib/python2.7/site-packages/autopep8.py --max-line-length 60 --in-place --aggressive --aggressive test.py
This works too:
python -m autopep8 --max-line-length 60 --in-place --aggressive --aggressive test.py
autopep8 imported in python interpreter is the same as the one pointing in vscode python.formatting.autopep8Path setting:
$ python
Python 2.7.16 (default, Apr 12 2019, 15:32:40)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import autopep8
>>> autopep8.__file__
'/usr/local/lib/python2.7/site-packages/autopep8.pyc
vscode setting:
"python.formatting.autopep8Path": "/usr/local/lib/python2.7/site-packages/autopep8.py"
Uninstalled all extensions, reloaded. Reinstalled all extensions.
When I had uninstalled all extensions, including Python. On "Format Document", I got a prompt asking me to choose formatter.
After reinstalling all extensions, including Python. On "Format Document", I get no prompt. I'm guessing it is honoring my user settings.
Meanwhile,
$ which python
/usr/local/bin/python
$ python --version
Python 2.7.16
Logs
No output in "Output" when I run "Format Document"
Console log on Developer Tools on "Format Document"
Environment data
autopep8 1.4.4
pycodestyle: 2.5.0
"python.jediEnabled"set to; more info How to update the language server to the latest stable version #3977): Jedi Enabled is "checked" (so, True?)Expected behaviour
When I run "Format Document", the file is formatted.
Actual behaviour
When I run "Format Document", the file is not formatted.
Steps to reproduce:
Current Settings:
User Settings (showing only Python related settings):
Workspace Settings:
Extensions:
What I have already tried:
autopep8is installed correctly to py2.7 :pip2 install --upgrade autopep8/usr/local/lib/python2.7/site-packages/autopep8.py --max-line-length 60 --in-place --aggressive --aggressive test.pypython -m autopep8 --max-line-length 60 --in-place --aggressive --aggressive test.pyautopep8imported in python interpreter is the same as the one pointing in vscodepython.formatting.autopep8Pathsetting:Meanwhile,
Logs