mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-18 18:45:07 +00:00
Rename Autofix
to Fix
(#7657)
**Summary** Mostly mechanical symbol rename and search-and-replace, with small changes to the markdown docs to read better
This commit is contained in:
parent
8028de8956
commit
1e173f7909
231 changed files with 943 additions and 960 deletions
|
@ -388,7 +388,7 @@ fn generate_iter_impl(
|
|||
fn register_rules<'a>(input: impl Iterator<Item = &'a Rule>) -> TokenStream {
|
||||
let mut rule_variants = quote!();
|
||||
let mut rule_message_formats_match_arms = quote!();
|
||||
let mut rule_autofixable_match_arms = quote!();
|
||||
let mut rule_fixable_match_arms = quote!();
|
||||
let mut rule_explanation_match_arms = quote!();
|
||||
|
||||
let mut from_impls_for_diagnostic_kind = quote!();
|
||||
|
@ -404,8 +404,8 @@ fn register_rules<'a>(input: impl Iterator<Item = &'a Rule>) -> TokenStream {
|
|||
// Apply the `attrs` to each arm, like `[cfg(feature = "foo")]`.
|
||||
rule_message_formats_match_arms
|
||||
.extend(quote! {#(#attrs)* Self::#name => <#path as ruff_diagnostics::Violation>::message_formats(),});
|
||||
rule_autofixable_match_arms.extend(
|
||||
quote! {#(#attrs)* Self::#name => <#path as ruff_diagnostics::Violation>::AUTOFIX,},
|
||||
rule_fixable_match_arms.extend(
|
||||
quote! {#(#attrs)* Self::#name => <#path as ruff_diagnostics::Violation>::FIX_KIND,},
|
||||
);
|
||||
rule_explanation_match_arms
|
||||
.extend(quote! {#(#attrs)* Self::#name => #path::explanation(),});
|
||||
|
@ -445,9 +445,9 @@ fn register_rules<'a>(input: impl Iterator<Item = &'a Rule>) -> TokenStream {
|
|||
match self { #rule_explanation_match_arms }
|
||||
}
|
||||
|
||||
/// Returns the autofix status of this rule.
|
||||
pub const fn autofixable(&self) -> ruff_diagnostics::AutofixKind {
|
||||
match self { #rule_autofixable_match_arms }
|
||||
/// Returns the fix status of this rule.
|
||||
pub const fn fixable(&self) -> ruff_diagnostics::FixKind {
|
||||
match self { #rule_fixable_match_arms }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ pub(crate) fn violation(violation: &ItemStruct) -> Result<TokenStream> {
|
|||
|
||||
Self {
|
||||
body: Violation::message(&value),
|
||||
suggestion: Violation::autofix_title(&value),
|
||||
suggestion: Violation::fix_title(&value),
|
||||
name: stringify!(#ident).to_string(),
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ pub(crate) fn violation(violation: &ItemStruct) -> Result<TokenStream> {
|
|||
|
||||
Self {
|
||||
body: Violation::message(&value),
|
||||
suggestion: Violation::autofix_title(&value),
|
||||
suggestion: Violation::fix_title(&value),
|
||||
name: stringify!(#ident).to_string(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue