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

Mapping error codes to severities #1762

Closed
WhyNotHugo opened this issue Nov 27, 2022 · 3 comments
Closed

Mapping error codes to severities #1762

WhyNotHugo opened this issue Nov 27, 2022 · 3 comments

Comments

@WhyNotHugo
Copy link

describe the request

IDEs and other developer tools usually handle diagnostics in multiple severities (the most common approach being Error, Warning, Info, Hint).

flake8 errors have no concept of severity, so when an IDE shows flake8 violations, there's no correct severity. Because of this, IDEs and/or their helpers have been instructed to them as Error.

This isn't helpful when trying to find an error in code. A scenarios I've faced many times, in trying to find what's the breakage in a file with many diagnostics: most of them being mere linting (e.g.: trailing whitespace), and one of them is a SyntaxError. Clearly, some of these are just Info and the latter is an Error. One should stand out more than others. There's an intrinsic order of severity in these.

However, downstream integrations and tools have no reference for this, and an upstream one would seem best. Mostly, all IDEs/plugins/etc would be able to re-use the same definitions and stay consistent.

I'd like to propose some form of mapping from error codes to one of the severalties above. Aside from somehow surfacing these for each existing error code, we'd need some mechanism for flake8 plugin authors to do the same for the error codes that they emit.

@asottile
Copy link
Member

how did you bypass the moderation limits?

@asottile
Copy link
Member

this seems unmanageable, and I'd argue things shouldn't report anything not actionable

@asottile
Copy link
Member

I don't think managing this in the framework or inside plugins makes sense. it's really up to the user to decide what severity they'd assign to various codes (for instance I might put "unused import" at error, but someone else might not care and put it at info or ignore it entirely). to flake8 they are all errors.

and at that point it's probably best that the IDE and IDE configuration presents those options to users.

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

No branches or pull requests

2 participants