diff --git a/ruff_macros/src/rule_code_prefix.rs b/ruff_macros/src/rule_code_prefix.rs index 3bdeca625a..6cf2210c46 100644 --- a/ruff_macros/src/rule_code_prefix.rs +++ b/ruff_macros/src/rule_code_prefix.rs @@ -242,19 +242,6 @@ fn generate_impls<'a>( } }); - let categories = prefix_to_codes.keys().map(|prefix_str| { - if prefix_str.chars().all(char::is_alphabetic) - && !PREFIX_REDIRECTS.contains_key(&prefix_str.as_str()) - { - let prefix = Ident::new(prefix_str, Span::call_site()); - quote! { - #prefix_ident::#prefix, - } - } else { - quote! {} - } - }); - quote! { impl #prefix_ident { pub fn specificity(&self) -> Specificity { @@ -276,7 +263,5 @@ fn generate_impls<'a>( } } } - - pub const CATEGORIES: &[#prefix_ident] = &[#(#categories)*]; } } diff --git a/src/settings/mod.rs b/src/settings/mod.rs index f534475064..5be43f5e92 100644 --- a/src/settings/mod.rs +++ b/src/settings/mod.rs @@ -13,7 +13,7 @@ use rustc_hash::FxHashSet; use self::hashable::{HashableGlobMatcher, HashableGlobSet, HashableHashSet, HashableRegex}; use self::rule_table::RuleTable; use crate::cache::cache_dir; -use crate::registry::{Rule, RuleSelector, Specificity, CATEGORIES, INCOMPATIBLE_CODES}; +use crate::registry::{Rule, RuleSelector, Specificity, INCOMPATIBLE_CODES}; use crate::rules::{ flake8_annotations, flake8_bandit, flake8_bugbear, flake8_builtins, flake8_errmsg, flake8_implicit_str_concat, flake8_import_conventions, flake8_pytest_style, flake8_quotes, @@ -240,7 +240,7 @@ impl From<&Configuration> for RuleTable { let mut rules = RuleTable::empty(); let fixable = resolve_codes([RuleCodeSpec { - select: config.fixable.as_deref().unwrap_or(CATEGORIES), + select: config.fixable.as_deref().unwrap_or(&[RuleSelector::ALL]), ignore: config.unfixable.as_deref().unwrap_or_default(), }]);