-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support suggesting different fixes for one violation #2713
Comments
It seems that we could add categories/tags related to autofixing?
Maybe a fix tagged as Was also wondering whether we want to have a tag that implies "sometimes" to capture issues like that raised for |
Yes such a categorization is indeed a good idea, we already have #1997 for tracking that :) |
Pandas-vet has one rule where multiple fixes are possible: |
Another example: B905 zip-without-explicit-strict has two possible autofixes ( |
These auto-fixes could be configured in settings. |
It depends. In most cases the autofix is constant per repository (in which case the autofix can be configured on repo level). We can also imagine to review on a case-by-case basis to be able to decide (something like |
Autobot reference in Ruff?? First time! |
Some violations can be fixed in different ways. The Language Server Protocol supports multiple code actions for one location, so it would be nice if ruff could also suggest multiple autofixes for one violation.
Examples:
try: ...; except ...: pass
-> flake8-simplify suggests usingcontextlib.suppress
instead, whereas flake8-bandit suggests logging the exceptionCan you think of other examples?
The text was updated successfully, but these errors were encountered: