mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
Rename FixKind
to FixAvailability
(#7658)
**Summary** `FixKind` feels to generic, i suggest renaming it to something like `FixAvailibility`. Commands used: ```bash rg FixKind --files-with-matches | xargs sed -i 's/FixKind/FixAvailability/g' rg fix_kind --files-with-matches | xargs sed -i 's/fix_kind/fix_availability/g' rg FIX_KIND --files-with-matches | xargs sed -i 's/FIX_KIND/FIX_AVAILABILITY/g' cargo fmt ``` `rg -i "fix.kind"` doesn't show any matches anymore.
This commit is contained in:
parent
ebdfcee87f
commit
0961f008b8
76 changed files with 185 additions and 179 deletions
|
@ -5,7 +5,7 @@ use serde::ser::SerializeSeq;
|
|||
use serde::{Serialize, Serializer};
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use ruff_diagnostics::FixKind;
|
||||
use ruff_diagnostics::FixAvailability;
|
||||
use ruff_linter::registry::{Linter, Rule, RuleNamespace};
|
||||
|
||||
use crate::args::HelpFormat;
|
||||
|
@ -51,9 +51,12 @@ fn format_rule_text(rule: Rule) -> String {
|
|||
output.push('\n');
|
||||
output.push('\n');
|
||||
|
||||
let fix_kind = rule.fixable();
|
||||
if matches!(fix_kind, FixKind::Always | FixKind::Sometimes) {
|
||||
output.push_str(&fix_kind.to_string());
|
||||
let fix_availability = rule.fixable();
|
||||
if matches!(
|
||||
fix_availability,
|
||||
FixAvailability::Always | FixAvailability::Sometimes
|
||||
) {
|
||||
output.push_str(&fix_availability.to_string());
|
||||
output.push('\n');
|
||||
output.push('\n');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue