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

Add threshold flag for mypy errors #18409

Open
rahulpal75 opened this issue Jan 2, 2025 · 3 comments
Open

Add threshold flag for mypy errors #18409

rahulpal75 opened this issue Jan 2, 2025 · 3 comments

Comments

@rahulpal75
Copy link

rahulpal75 commented Jan 2, 2025

Feature
Currently mypy has flags to disable error based on the error codes. But There is no such options to add threshold for number of errors.
I came across --max-error-count but this option is not working in python 3.9.
Hence i am requesting to add some flag similar to --max-error-count which will throw error if the number of error count exceed the given value.

Pitch

There are many teams which has not on-boarded to mypy . And if someone try to onboard, then that team either has to fix all the errors or ignore the error. But by adding this feature team can onboard to mypy and can fix the error incrementally by controlling the threshold value.

@A5rocks
Copy link
Contributor

A5rocks commented Jan 2, 2025

In the meanwhile, teams can always use an extra script to filter mypy's output.

That doesn't detract from this feature request though.

@rahulpal75
Copy link
Author

In the meanwhile, teams can always use an extra script to filter mypy's output.

That doesn't detract from this feature request though.

Can you please share some example of doing this.

@A5rocks
Copy link
Contributor

A5rocks commented Jan 2, 2025

In the meanwhile, teams can always use an extra script to filter mypy's output.

That doesn't detract from this feature request though.

Can you please share some example of doing this.

I don't have any specific examples but https://github.com/python-trio/trio/blob/main/src/trio/_tools/mypy_annotate.py translates mypy's output to GitHub annotations. It wouldn't take much time to modify it to count the number of a certain error and only return an error if it's too high.

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

3 participants