-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Rename FixKind
to FixAvailability
#7658
Conversation
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
I think this is more akin to "availability" -- it's an indicator of how often the rule is fixable, which is separate from the confidence of the fix itself which is the |
a83fb23
to
7952051
Compare
FixKind
to FixConfidence
FixKind
to FixAvailability
sorry i was blind |
7952051
to
d02ef0b
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
crates/ruff_dev/src/generate_docs.rs
Outdated
let fix_kind = rule.fixable(); | ||
if matches!(fix_kind, FixKind::Always | FixKind::Sometimes) { | ||
output.push_str(&fix_kind.to_string()); | ||
let fix_confidence = rule.fixable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably update this variable name throughout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is FixAvailability
the name we want to go with? If so i'll change everything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me!
e402183
to
1addc0c
Compare
7c087d3
to
cded4c2
Compare
cded4c2
to
bfb34b4
Compare
Updated the PR description |
crates/ruff_linter/src/test.rs
Outdated
(false, FixKind::Always) => { | ||
panic!("Rule {rule:?} is marked to always-fixable but the diagnostic has no fix. Either ensure you always emit a fix or change `Violation::FIX_KINDd` to either `FixKind::Sometimes` or `FixKind::None") | ||
(false, FixAvailability::Always) => { | ||
panic!("Rule {rule:?} is marked to always-fixable but the diagnostic has no fix. Either ensure you always emit a fix or change `Violation::FIX_AVAILIBITYd` to either `FixAvailability::Sometimes` or `FixAvailability::None") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a typo in Violation::FIX_AVAILIBITYd
(which was already present before, but worth fixing).
Please ping me if there are any PRs that need merge conflicts due to this fixed |
Summary
FixKind
feels to generic, i suggest renaming it to something likeFixAvailibility
.Commands used:
rg -i "fix.kind"
doesn't show any matches anymore.