[TRIAGE] Context Menu document formatting not addressing E501 line too long
thecircleoflifefree opened this issue · 1 comments
When trying to use autopep8 with -> Right click on the python file while open and select Format Document with...
option, nothing happens to the file, meaning it's not getting edited, yet the output of the trace shows the event of formatting,
To use as a double confirmation, I ensure that the issue still exists by checking with pycodestyle
.
WINDOWS INFO
Edition Windows 11 Home Single Language
Version 22H2
Installed on 11/27/2023
OS build 22621.2715
Experience Windows Feature Experience Pack 1000.22677.1000.0
PYTHON INFO
PS C:\Users\<USER>\Documents\GitHub\tse> py.exe --version
Python 3.12.0
with virtual environment activated
(.venv) PS C:\Users\<USER>\Documents\GitHub\tse> py.exe --version
Python 3.12.0
VSCODE INFO
_Version: 1.84.2 (user setup)
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:51:52.184Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621_
PEP8 ISSUE
`(.venv) PS C:\Users\<user>\Documents\GitHub\tse> pycodestyle --first .\servicioelectoral.py
.\servicioelectoral.py:13:80: E501 line too long (85 > 79 characters)
(.venv) PS C:\Users\<user>\Documents\GitHub\tse> `
Output option for autopep8 shows:
2023-12-06 09:33:57.235 [info] [Trace - 9:33:57 AM] Sending request 'textDocument/formatting - (1)'.
2023-12-06 09:33:57.257 [info] [Trace - 9:33:57 AM] Received notification 'window/logMessage'.
2023-12-06 09:33:57.257 [info] c:\Users<user>\Documents\GitHub\tse.venv\Scripts\python.exe -m autopep8 -
2023-12-06 09:33:57.257 [info] [Trace - 9:33:57 AM] Received notification 'window/logMessage'.
2023-12-06 09:33:57.257 [info] CWD Server: c:\Users<user>\Documents\GitHub\tse
2023-12-06 09:33:57.387 [info] [Trace - 9:33:57 AM] Received response 'textDocument/formatting - (1)' in 152ms.
Restarted VSCODE and enabled Developer Set Log level
to Debug for autope8, yet the results when formatting are the same.
Retried additionally with VSCODE as Run as Administrator
2023-12-06 10:25:31.045 [info] c:\Users<user>\Documents\GitHub\tse.venv\Scripts\python.exe -m autopep8 --version
2023-12-06 10:25:31.090 [info] CWD Server: c:\Users<user>\Documents\GitHub\tse
2023-12-06 10:25:31.095 [info] Version info for formatter running for C:\Users<user>\Documents\GitHub\tse:
autopep8 2.0.4 (pycodestyle: 2.11.1)2023-12-06 10:25:31.132 [info] SUPPORTED autopep8>=1.7.0
FOUND autopep8==2.0.42023-12-06 10:27:14.235 [info] [Trace - 10:27:14 AM] Sending request 'textDocument/formatting - (1)'.
2023-12-06 10:27:14.256 [info] [Trace - 10:27:14 AM] Received notification 'window/logMessage'.
2023-12-06 10:27:14.256 [info] c:\Users<user>\Documents\GitHub\tse.venv\Scripts\python.exe -m autopep8 -
2023-12-06 10:27:14.257 [info] [Trace - 10:27:14 AM] Received notification 'window/logMessage'.
2023-12-06 10:27:14.257 [info] CWD Server: c:\Users<user>\Documents\GitHub\tse
2023-12-06 10:27:14.390 [info] [Trace - 10:27:14 AM] Received response 'textDocument/formatting - (1)' in 156ms.
@thecircleoflifefree We run autopep8
and provide whatever it returns to VS Code. This seems like an issue with autopep8
. You can verify this by running this.
> type .\servicioelectoral.py | python -m autopep8 -
Be sure to have autopep8
installed in your environment when running it from terminal. The builtin autopep8
is not available to the terminal.