Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some messages written to stdout instead of stderr #717

Open
herring-swe opened this issue Nov 28, 2023 · 1 comment
Open

Some messages written to stdout instead of stderr #717

herring-swe opened this issue Nov 28, 2023 · 1 comment

Comments

@herring-swe
Copy link

herring-swe commented Nov 28, 2023

autopep8 outputs some warnings and verbose messages to stdout instead of stderr.
This leads to problems when someone (such as vscode extension vscode-autopep8) wants to format not using --in-place flag since there's no distinction between output code and processing messages and thus writes the message into the new code..
See: microsoft/vscode-autopep8#201


Command Line and Configuration

~/.config/pycodestyle

[pycodestyle]
max-complexity = 20

Command Line

$ python -m autopep8 -i file.py -vvv 2>/dev/null
read config path: /home/xyz/.config/pycodestyle
  unknown option 'max-complexity' ignored
$ python -m autopep8 -i file.py -vvv 1>/dev/null
[file:file.py]
--->  10 issue(s) to fix {'E221': {13, 14, 15, 16, 17, 18, 19}, 'E501': {72, 122, 100}}
--->  Not fixing E501 on line 72
--->  Not fixing E501 on line 100
--->  Not fixing E501 on line 122

Your Environment

  • Python version: 2.0.4
  • autopep8 version: 2.11.1
@hhatto
Copy link
Owner

hhatto commented May 29, 2024

This behaviour is part of what autopep8 does on the pycodestyle side when it runs pycodestyle.
It is difficult to fix on the autopep8 side.

https://github.com/PyCQA/pycodestyle/blob/710363bd2048d9c7fa3f24dcaf21e40ced7f74d5/pycodestyle.py#L2539

The first step in addressing this issue is to remove configuration options not supported by pycodestyle from the configuration file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants