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

Autofix applicability #1997

Closed
not-my-profile opened this issue Jan 19, 2023 · 8 comments
Closed

Autofix applicability #1997

not-my-profile opened this issue Jan 19, 2023 · 8 comments
Labels
core Related to core functionality

Comments

@not-my-profile
Copy link
Contributor

not-my-profile commented Jan 19, 2023

Like categorization (#1774) this is another very useful concept we can steal from Rust, see rustc_errors::Applicability.

Ideally users would be able to choose how much they want to risk when applying lints.

I think for rule applicability is even more relevant for Python than for Rust since pretty much all of the behavior of Python types can be overriden by implementing custom __dunder__ methods.

@sbrugman
Copy link
Contributor

Referenced this in a couple of issues that could use this functionality

@charliermarsh
Copy link
Member

Thank you!

@charliermarsh
Copy link
Member

Would this primarily be for autofix risk, or also, flagging violations in the first place?

@not-my-profile
Copy link
Contributor Author

What do you mean with "flagging violations in the first place"?

I think there are different factors we could possibly differentiate:

  1. How accurate is the violation detection? e.g. can false positives / false negatives occur? how likely is that?
  2. How safe is the suggested autofix? Can it be wrong? Can it break the program? Could it have side-effects?

@charliermarsh
Copy link
Member

Right -- those are the two factors that I was trying to tease apart, though I think I was just tired and missed that the issue title is about autofixing, so any analogous concept for "How accurate is the violation detection?" would probably go by a different name.

@not-my-profile
Copy link
Contributor Author

I think it makes sense to raise this question here. I think rules that will have many false positives should just be disabled by default and categorized (#1774) accordingly.

@zanieb
Copy link
Member

zanieb commented Jun 14, 2023

I think this work is better captured by #4181 now, should we close this issue in favor of that one?

As an additional xref, here's the pull request that added applicability levels #4303

@charliermarsh
Copy link
Member

Yeah, good call -- closing in favor of #4181.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to core functionality
Projects
None yet
Development

No branches or pull requests

4 participants