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

Change severity level for flake8 errors #223

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Change severity level for flake8 errors #223

merged 1 commit into from
Jun 17, 2022

Conversation

jhossbach
Copy link
Member

@jhossbach jhossbach commented Jun 17, 2022

See #220. The severity flag for all flake8 diagnostics are declared as warning. With this PR, all flake8 messages starting with "E" (includes messages from pycodestyle) are parsed with error severity level.

Fixes #220

@ccordoba12 ccordoba12 changed the title Severity level for flake8 error Change severity level for flake8 errors Jun 17, 2022
@ccordoba12 ccordoba12 added this to the v1.5.0 milestone Jun 17, 2022
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @jhossbach!

@ccordoba12 ccordoba12 merged commit fdf2b22 into python-lsp:develop Jun 17, 2022
@jhossbach
Copy link
Member Author

Glad to be of help :)

@lcheylus
Copy link
Contributor

This fix is invalid : with it, every error code Exxx from Flake8 have Error severity level.

See https://flake8.pycqa.org/en/latest/user/error-codes.html, https://flake8.pycqa.org/en/latest/glossary.html#term-error-code and https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes

Error codes from Flake8 :

  • Fxxx : error codes from PyFlakes, must have Error severity level (for now Warning severity, see issue Flake8 reports wrong severity level for code Fxxx #230)
  • E999 : error codes with invalid AST => OK, Error severity level with this PR
  • Exxx : error codes from pydocstyle, must have Warning severity level (only syntax errors for PEP-8). Wrong severity level with this PR
  • Wxxx : warning codes from pydocstyle => OK, Warning severity

The same severity levels are used when pydocstyle and PyFlakes are used directly instead of Flake8 plugin.

lcheylus added a commit to lcheylus/python-lsp-server that referenced this pull request Jun 30, 2022
Error codes from Flake8 :
  - Fxxx : checks from PyFlakes => Error severity level
  - E999 : code for invalid AST => Error severity level
  - Exxx : checks from pydocstyle (syntax checks for PEP-8) => Warning
    severity level
  - Wxxx : checks from pydocstyle (syntax checks for PEP-8) => Warning
    severity level

Closes python-lsp#230
Fix PR python-lsp#223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flake8 reports wrong severity level for E999
3 participants