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

idea: add generic name to rule violations if message contains formatted strings when output in --statistics #11097

Open
diceroll123 opened this issue Apr 23, 2024 · 1 comment

Comments

@diceroll123
Copy link
Contributor

This is probably a bit of a stretch to ask, but running ruff check --select=ANN201 --statistics for example will show something like

25445	ANN201	Missing return type annotation for public function `THING`

Which obviously does not actually apply to all 25445 instances of the ANN201 violations.

So I propose some generic analogue to Violation::message but for the basic violation. In this case, Missing return type annotation for public function.

Of course, this suggestion applies to all violations with formatted strings.

@MichaReiser
Copy link
Member

This sounds reasonable, although adding one more field to all violations is a rather involved change (and having it on Message also has a performance cost). I wonder if we should just show the rule name instead with a link or change the titles of our rules to never include dynamic parts?

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