diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 188735147d..a1be271990 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -111,7 +111,7 @@ At a high level, the steps involved in adding a new lint rule are as follows: 1. In that file, define a violation struct. You can grep for `#[violation]` to see examples. -1. Map the violation struct to a rule code in `crates/ruff/src/registry.rs` (e.g., `E402`). +1. Map the violation struct to a rule code in `crates/ruff/src/codes.rs` (e.g., `E402`). 1. Define the logic for triggering the violation in `crates/ruff/src/checkers/ast/mod.rs` (for AST-based checks), `crates/ruff/src/checkers/tokens.rs` (for token-based checks), diff --git a/crates/ruff/src/codes.rs b/crates/ruff/src/codes.rs index ea806852d8..920c74e568 100644 --- a/crates/ruff/src/codes.rs +++ b/crates/ruff/src/codes.rs @@ -1,6 +1,15 @@ +/// In this module we generate [`Rule`], an enum of all rules, and [`RuleCodePrefix`], an enum of +/// all rules categories. A rule category is something like pyflakes or flake8-todos. Each rule +/// category contains all rules and their common prefixes, i.e. everything you can specify in +/// `--select`. For pylint this is e.g. C0414 and E0118 but also C and E01. use std::fmt::Formatter; -use crate::registry::{Linter, Rule}; +use strum_macros::{AsRefStr, EnumIter}; + +use ruff_diagnostics::Violation; + +use crate::registry::{AsRule, Linter}; +use crate::rules; #[derive(PartialEq, Eq, PartialOrd, Ord)] pub struct NoqaCode(&'static str, &'static str); @@ -42,729 +51,729 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> { #[rustfmt::skip] Some(match (linter, code) { // pycodestyle errors - (Pycodestyle, "E101") => (RuleGroup::Unspecified, Rule::MixedSpacesAndTabs), - (Pycodestyle, "E111") => (RuleGroup::Nursery, Rule::IndentationWithInvalidMultiple), - (Pycodestyle, "E112") => (RuleGroup::Nursery, Rule::NoIndentedBlock), - (Pycodestyle, "E113") => (RuleGroup::Nursery, Rule::UnexpectedIndentation), - (Pycodestyle, "E114") => (RuleGroup::Nursery, Rule::IndentationWithInvalidMultipleComment), - (Pycodestyle, "E115") => (RuleGroup::Nursery, Rule::NoIndentedBlockComment), - (Pycodestyle, "E116") => (RuleGroup::Nursery, Rule::UnexpectedIndentationComment), - (Pycodestyle, "E117") => (RuleGroup::Nursery, Rule::OverIndented), - (Pycodestyle, "E201") => (RuleGroup::Nursery, Rule::WhitespaceAfterOpenBracket), - (Pycodestyle, "E202") => (RuleGroup::Nursery, Rule::WhitespaceBeforeCloseBracket), - (Pycodestyle, "E203") => (RuleGroup::Nursery, Rule::WhitespaceBeforePunctuation), - (Pycodestyle, "E211") => (RuleGroup::Nursery, Rule::WhitespaceBeforeParameters), - (Pycodestyle, "E221") => (RuleGroup::Nursery, Rule::MultipleSpacesBeforeOperator), - (Pycodestyle, "E222") => (RuleGroup::Nursery, Rule::MultipleSpacesAfterOperator), - (Pycodestyle, "E223") => (RuleGroup::Nursery, Rule::TabBeforeOperator), - (Pycodestyle, "E224") => (RuleGroup::Nursery, Rule::TabAfterOperator), - (Pycodestyle, "E225") => (RuleGroup::Nursery, Rule::MissingWhitespaceAroundOperator), - (Pycodestyle, "E226") => (RuleGroup::Nursery, Rule::MissingWhitespaceAroundArithmeticOperator), - (Pycodestyle, "E227") => (RuleGroup::Nursery, Rule::MissingWhitespaceAroundBitwiseOrShiftOperator), - (Pycodestyle, "E228") => (RuleGroup::Nursery, Rule::MissingWhitespaceAroundModuloOperator), - (Pycodestyle, "E231") => (RuleGroup::Nursery, Rule::MissingWhitespace), - (Pycodestyle, "E251") => (RuleGroup::Nursery, Rule::UnexpectedSpacesAroundKeywordParameterEquals), - (Pycodestyle, "E252") => (RuleGroup::Nursery, Rule::MissingWhitespaceAroundParameterEquals), - (Pycodestyle, "E261") => (RuleGroup::Nursery, Rule::TooFewSpacesBeforeInlineComment), - (Pycodestyle, "E262") => (RuleGroup::Nursery, Rule::NoSpaceAfterInlineComment), - (Pycodestyle, "E265") => (RuleGroup::Nursery, Rule::NoSpaceAfterBlockComment), - (Pycodestyle, "E266") => (RuleGroup::Nursery, Rule::MultipleLeadingHashesForBlockComment), - (Pycodestyle, "E271") => (RuleGroup::Nursery, Rule::MultipleSpacesAfterKeyword), - (Pycodestyle, "E272") => (RuleGroup::Nursery, Rule::MultipleSpacesBeforeKeyword), - (Pycodestyle, "E273") => (RuleGroup::Nursery, Rule::TabAfterKeyword), - (Pycodestyle, "E274") => (RuleGroup::Nursery, Rule::TabBeforeKeyword), - (Pycodestyle, "E275") => (RuleGroup::Nursery, Rule::MissingWhitespaceAfterKeyword), - (Pycodestyle, "E401") => (RuleGroup::Unspecified, Rule::MultipleImportsOnOneLine), - (Pycodestyle, "E402") => (RuleGroup::Unspecified, Rule::ModuleImportNotAtTopOfFile), - (Pycodestyle, "E501") => (RuleGroup::Unspecified, Rule::LineTooLong), - (Pycodestyle, "E701") => (RuleGroup::Unspecified, Rule::MultipleStatementsOnOneLineColon), - (Pycodestyle, "E702") => (RuleGroup::Unspecified, Rule::MultipleStatementsOnOneLineSemicolon), - (Pycodestyle, "E703") => (RuleGroup::Unspecified, Rule::UselessSemicolon), - (Pycodestyle, "E711") => (RuleGroup::Unspecified, Rule::NoneComparison), - (Pycodestyle, "E712") => (RuleGroup::Unspecified, Rule::TrueFalseComparison), - (Pycodestyle, "E713") => (RuleGroup::Unspecified, Rule::NotInTest), - (Pycodestyle, "E714") => (RuleGroup::Unspecified, Rule::NotIsTest), - (Pycodestyle, "E721") => (RuleGroup::Unspecified, Rule::TypeComparison), - (Pycodestyle, "E722") => (RuleGroup::Unspecified, Rule::BareExcept), - (Pycodestyle, "E731") => (RuleGroup::Unspecified, Rule::LambdaAssignment), - (Pycodestyle, "E741") => (RuleGroup::Unspecified, Rule::AmbiguousVariableName), - (Pycodestyle, "E742") => (RuleGroup::Unspecified, Rule::AmbiguousClassName), - (Pycodestyle, "E743") => (RuleGroup::Unspecified, Rule::AmbiguousFunctionName), - (Pycodestyle, "E902") => (RuleGroup::Unspecified, Rule::IOError), - (Pycodestyle, "E999") => (RuleGroup::Unspecified, Rule::SyntaxError), + (Pycodestyle, "E101") => (RuleGroup::Unspecified, rules::pycodestyle::rules::MixedSpacesAndTabs), + (Pycodestyle, "E111") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::IndentationWithInvalidMultiple), + (Pycodestyle, "E112") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::NoIndentedBlock), + (Pycodestyle, "E113") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::UnexpectedIndentation), + (Pycodestyle, "E114") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::IndentationWithInvalidMultipleComment), + (Pycodestyle, "E115") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::NoIndentedBlockComment), + (Pycodestyle, "E116") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::UnexpectedIndentationComment), + (Pycodestyle, "E117") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::OverIndented), + (Pycodestyle, "E201") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::WhitespaceAfterOpenBracket), + (Pycodestyle, "E202") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::WhitespaceBeforeCloseBracket), + (Pycodestyle, "E203") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::WhitespaceBeforePunctuation), + (Pycodestyle, "E211") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::WhitespaceBeforeParameters), + (Pycodestyle, "E221") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MultipleSpacesBeforeOperator), + (Pycodestyle, "E222") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MultipleSpacesAfterOperator), + (Pycodestyle, "E223") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::TabBeforeOperator), + (Pycodestyle, "E224") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::TabAfterOperator), + (Pycodestyle, "E225") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundOperator), + (Pycodestyle, "E226") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundArithmeticOperator), + (Pycodestyle, "E227") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundBitwiseOrShiftOperator), + (Pycodestyle, "E228") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundModuloOperator), + (Pycodestyle, "E231") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MissingWhitespace), + (Pycodestyle, "E251") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::UnexpectedSpacesAroundKeywordParameterEquals), + (Pycodestyle, "E252") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundParameterEquals), + (Pycodestyle, "E261") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::TooFewSpacesBeforeInlineComment), + (Pycodestyle, "E262") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::NoSpaceAfterInlineComment), + (Pycodestyle, "E265") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::NoSpaceAfterBlockComment), + (Pycodestyle, "E266") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MultipleLeadingHashesForBlockComment), + (Pycodestyle, "E271") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MultipleSpacesAfterKeyword), + (Pycodestyle, "E272") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MultipleSpacesBeforeKeyword), + (Pycodestyle, "E273") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::TabAfterKeyword), + (Pycodestyle, "E274") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::TabBeforeKeyword), + (Pycodestyle, "E275") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::MissingWhitespaceAfterKeyword), + (Pycodestyle, "E401") => (RuleGroup::Unspecified, rules::pycodestyle::rules::MultipleImportsOnOneLine), + (Pycodestyle, "E402") => (RuleGroup::Unspecified, rules::pycodestyle::rules::ModuleImportNotAtTopOfFile), + (Pycodestyle, "E501") => (RuleGroup::Unspecified, rules::pycodestyle::rules::LineTooLong), + (Pycodestyle, "E701") => (RuleGroup::Unspecified, rules::pycodestyle::rules::MultipleStatementsOnOneLineColon), + (Pycodestyle, "E702") => (RuleGroup::Unspecified, rules::pycodestyle::rules::MultipleStatementsOnOneLineSemicolon), + (Pycodestyle, "E703") => (RuleGroup::Unspecified, rules::pycodestyle::rules::UselessSemicolon), + (Pycodestyle, "E711") => (RuleGroup::Unspecified, rules::pycodestyle::rules::NoneComparison), + (Pycodestyle, "E712") => (RuleGroup::Unspecified, rules::pycodestyle::rules::TrueFalseComparison), + (Pycodestyle, "E713") => (RuleGroup::Unspecified, rules::pycodestyle::rules::NotInTest), + (Pycodestyle, "E714") => (RuleGroup::Unspecified, rules::pycodestyle::rules::NotIsTest), + (Pycodestyle, "E721") => (RuleGroup::Unspecified, rules::pycodestyle::rules::TypeComparison), + (Pycodestyle, "E722") => (RuleGroup::Unspecified, rules::pycodestyle::rules::BareExcept), + (Pycodestyle, "E731") => (RuleGroup::Unspecified, rules::pycodestyle::rules::LambdaAssignment), + (Pycodestyle, "E741") => (RuleGroup::Unspecified, rules::pycodestyle::rules::AmbiguousVariableName), + (Pycodestyle, "E742") => (RuleGroup::Unspecified, rules::pycodestyle::rules::AmbiguousClassName), + (Pycodestyle, "E743") => (RuleGroup::Unspecified, rules::pycodestyle::rules::AmbiguousFunctionName), + (Pycodestyle, "E902") => (RuleGroup::Unspecified, rules::pycodestyle::rules::IOError), + (Pycodestyle, "E999") => (RuleGroup::Unspecified, rules::pycodestyle::rules::SyntaxError), // pycodestyle warnings - (Pycodestyle, "W191") => (RuleGroup::Unspecified, Rule::TabIndentation), - (Pycodestyle, "W291") => (RuleGroup::Unspecified, Rule::TrailingWhitespace), - (Pycodestyle, "W292") => (RuleGroup::Unspecified, Rule::MissingNewlineAtEndOfFile), - (Pycodestyle, "W293") => (RuleGroup::Unspecified, Rule::BlankLineWithWhitespace), - (Pycodestyle, "W505") => (RuleGroup::Unspecified, Rule::DocLineTooLong), - (Pycodestyle, "W605") => (RuleGroup::Unspecified, Rule::InvalidEscapeSequence), + (Pycodestyle, "W191") => (RuleGroup::Unspecified, rules::pycodestyle::rules::TabIndentation), + (Pycodestyle, "W291") => (RuleGroup::Unspecified, rules::pycodestyle::rules::TrailingWhitespace), + (Pycodestyle, "W292") => (RuleGroup::Unspecified, rules::pycodestyle::rules::MissingNewlineAtEndOfFile), + (Pycodestyle, "W293") => (RuleGroup::Unspecified, rules::pycodestyle::rules::BlankLineWithWhitespace), + (Pycodestyle, "W505") => (RuleGroup::Unspecified, rules::pycodestyle::rules::DocLineTooLong), + (Pycodestyle, "W605") => (RuleGroup::Unspecified, rules::pycodestyle::rules::InvalidEscapeSequence), // pyflakes - (Pyflakes, "401") => (RuleGroup::Unspecified, Rule::UnusedImport), - (Pyflakes, "402") => (RuleGroup::Unspecified, Rule::ImportShadowedByLoopVar), - (Pyflakes, "403") => (RuleGroup::Unspecified, Rule::UndefinedLocalWithImportStar), - (Pyflakes, "404") => (RuleGroup::Unspecified, Rule::LateFutureImport), - (Pyflakes, "405") => (RuleGroup::Unspecified, Rule::UndefinedLocalWithImportStarUsage), - (Pyflakes, "406") => (RuleGroup::Unspecified, Rule::UndefinedLocalWithNestedImportStarUsage), - (Pyflakes, "407") => (RuleGroup::Unspecified, Rule::FutureFeatureNotDefined), - (Pyflakes, "501") => (RuleGroup::Unspecified, Rule::PercentFormatInvalidFormat), - (Pyflakes, "502") => (RuleGroup::Unspecified, Rule::PercentFormatExpectedMapping), - (Pyflakes, "503") => (RuleGroup::Unspecified, Rule::PercentFormatExpectedSequence), - (Pyflakes, "504") => (RuleGroup::Unspecified, Rule::PercentFormatExtraNamedArguments), - (Pyflakes, "505") => (RuleGroup::Unspecified, Rule::PercentFormatMissingArgument), - (Pyflakes, "506") => (RuleGroup::Unspecified, Rule::PercentFormatMixedPositionalAndNamed), - (Pyflakes, "507") => (RuleGroup::Unspecified, Rule::PercentFormatPositionalCountMismatch), - (Pyflakes, "508") => (RuleGroup::Unspecified, Rule::PercentFormatStarRequiresSequence), - (Pyflakes, "509") => (RuleGroup::Unspecified, Rule::PercentFormatUnsupportedFormatCharacter), - (Pyflakes, "521") => (RuleGroup::Unspecified, Rule::StringDotFormatInvalidFormat), - (Pyflakes, "522") => (RuleGroup::Unspecified, Rule::StringDotFormatExtraNamedArguments), - (Pyflakes, "523") => (RuleGroup::Unspecified, Rule::StringDotFormatExtraPositionalArguments), - (Pyflakes, "524") => (RuleGroup::Unspecified, Rule::StringDotFormatMissingArguments), - (Pyflakes, "525") => (RuleGroup::Unspecified, Rule::StringDotFormatMixingAutomatic), - (Pyflakes, "541") => (RuleGroup::Unspecified, Rule::FStringMissingPlaceholders), - (Pyflakes, "601") => (RuleGroup::Unspecified, Rule::MultiValueRepeatedKeyLiteral), - (Pyflakes, "602") => (RuleGroup::Unspecified, Rule::MultiValueRepeatedKeyVariable), - (Pyflakes, "621") => (RuleGroup::Unspecified, Rule::ExpressionsInStarAssignment), - (Pyflakes, "622") => (RuleGroup::Unspecified, Rule::MultipleStarredExpressions), - (Pyflakes, "631") => (RuleGroup::Unspecified, Rule::AssertTuple), - (Pyflakes, "632") => (RuleGroup::Unspecified, Rule::IsLiteral), - (Pyflakes, "633") => (RuleGroup::Unspecified, Rule::InvalidPrintSyntax), - (Pyflakes, "634") => (RuleGroup::Unspecified, Rule::IfTuple), - (Pyflakes, "701") => (RuleGroup::Unspecified, Rule::BreakOutsideLoop), - (Pyflakes, "702") => (RuleGroup::Unspecified, Rule::ContinueOutsideLoop), - (Pyflakes, "704") => (RuleGroup::Unspecified, Rule::YieldOutsideFunction), - (Pyflakes, "706") => (RuleGroup::Unspecified, Rule::ReturnOutsideFunction), - (Pyflakes, "707") => (RuleGroup::Unspecified, Rule::DefaultExceptNotLast), - (Pyflakes, "722") => (RuleGroup::Unspecified, Rule::ForwardAnnotationSyntaxError), - (Pyflakes, "811") => (RuleGroup::Unspecified, Rule::RedefinedWhileUnused), - (Pyflakes, "821") => (RuleGroup::Unspecified, Rule::UndefinedName), - (Pyflakes, "822") => (RuleGroup::Unspecified, Rule::UndefinedExport), - (Pyflakes, "823") => (RuleGroup::Unspecified, Rule::UndefinedLocal), - (Pyflakes, "841") => (RuleGroup::Unspecified, Rule::UnusedVariable), - (Pyflakes, "842") => (RuleGroup::Unspecified, Rule::UnusedAnnotation), - (Pyflakes, "901") => (RuleGroup::Unspecified, Rule::RaiseNotImplemented), + (Pyflakes, "401") => (RuleGroup::Unspecified, rules::pyflakes::rules::UnusedImport), + (Pyflakes, "402") => (RuleGroup::Unspecified, rules::pyflakes::rules::ImportShadowedByLoopVar), + (Pyflakes, "403") => (RuleGroup::Unspecified, rules::pyflakes::rules::UndefinedLocalWithImportStar), + (Pyflakes, "404") => (RuleGroup::Unspecified, rules::pyflakes::rules::LateFutureImport), + (Pyflakes, "405") => (RuleGroup::Unspecified, rules::pyflakes::rules::UndefinedLocalWithImportStarUsage), + (Pyflakes, "406") => (RuleGroup::Unspecified, rules::pyflakes::rules::UndefinedLocalWithNestedImportStarUsage), + (Pyflakes, "407") => (RuleGroup::Unspecified, rules::pyflakes::rules::FutureFeatureNotDefined), + (Pyflakes, "501") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatInvalidFormat), + (Pyflakes, "502") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatExpectedMapping), + (Pyflakes, "503") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatExpectedSequence), + (Pyflakes, "504") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatExtraNamedArguments), + (Pyflakes, "505") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatMissingArgument), + (Pyflakes, "506") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatMixedPositionalAndNamed), + (Pyflakes, "507") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatPositionalCountMismatch), + (Pyflakes, "508") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatStarRequiresSequence), + (Pyflakes, "509") => (RuleGroup::Unspecified, rules::pyflakes::rules::PercentFormatUnsupportedFormatCharacter), + (Pyflakes, "521") => (RuleGroup::Unspecified, rules::pyflakes::rules::StringDotFormatInvalidFormat), + (Pyflakes, "522") => (RuleGroup::Unspecified, rules::pyflakes::rules::StringDotFormatExtraNamedArguments), + (Pyflakes, "523") => (RuleGroup::Unspecified, rules::pyflakes::rules::StringDotFormatExtraPositionalArguments), + (Pyflakes, "524") => (RuleGroup::Unspecified, rules::pyflakes::rules::StringDotFormatMissingArguments), + (Pyflakes, "525") => (RuleGroup::Unspecified, rules::pyflakes::rules::StringDotFormatMixingAutomatic), + (Pyflakes, "541") => (RuleGroup::Unspecified, rules::pyflakes::rules::FStringMissingPlaceholders), + (Pyflakes, "601") => (RuleGroup::Unspecified, rules::pyflakes::rules::MultiValueRepeatedKeyLiteral), + (Pyflakes, "602") => (RuleGroup::Unspecified, rules::pyflakes::rules::MultiValueRepeatedKeyVariable), + (Pyflakes, "621") => (RuleGroup::Unspecified, rules::pyflakes::rules::ExpressionsInStarAssignment), + (Pyflakes, "622") => (RuleGroup::Unspecified, rules::pyflakes::rules::MultipleStarredExpressions), + (Pyflakes, "631") => (RuleGroup::Unspecified, rules::pyflakes::rules::AssertTuple), + (Pyflakes, "632") => (RuleGroup::Unspecified, rules::pyflakes::rules::IsLiteral), + (Pyflakes, "633") => (RuleGroup::Unspecified, rules::pyflakes::rules::InvalidPrintSyntax), + (Pyflakes, "634") => (RuleGroup::Unspecified, rules::pyflakes::rules::IfTuple), + (Pyflakes, "701") => (RuleGroup::Unspecified, rules::pyflakes::rules::BreakOutsideLoop), + (Pyflakes, "702") => (RuleGroup::Unspecified, rules::pyflakes::rules::ContinueOutsideLoop), + (Pyflakes, "704") => (RuleGroup::Unspecified, rules::pyflakes::rules::YieldOutsideFunction), + (Pyflakes, "706") => (RuleGroup::Unspecified, rules::pyflakes::rules::ReturnOutsideFunction), + (Pyflakes, "707") => (RuleGroup::Unspecified, rules::pyflakes::rules::DefaultExceptNotLast), + (Pyflakes, "722") => (RuleGroup::Unspecified, rules::pyflakes::rules::ForwardAnnotationSyntaxError), + (Pyflakes, "811") => (RuleGroup::Unspecified, rules::pyflakes::rules::RedefinedWhileUnused), + (Pyflakes, "821") => (RuleGroup::Unspecified, rules::pyflakes::rules::UndefinedName), + (Pyflakes, "822") => (RuleGroup::Unspecified, rules::pyflakes::rules::UndefinedExport), + (Pyflakes, "823") => (RuleGroup::Unspecified, rules::pyflakes::rules::UndefinedLocal), + (Pyflakes, "841") => (RuleGroup::Unspecified, rules::pyflakes::rules::UnusedVariable), + (Pyflakes, "842") => (RuleGroup::Unspecified, rules::pyflakes::rules::UnusedAnnotation), + (Pyflakes, "901") => (RuleGroup::Unspecified, rules::pyflakes::rules::RaiseNotImplemented), // pylint - (Pylint, "C0414") => (RuleGroup::Unspecified, Rule::UselessImportAlias), - (Pylint, "C1901") => (RuleGroup::Unspecified, Rule::CompareToEmptyString), - (Pylint, "C3002") => (RuleGroup::Unspecified, Rule::UnnecessaryDirectLambdaCall), - (Pylint, "C0208") => (RuleGroup::Unspecified, Rule::IterationOverSet), - (Pylint, "E0100") => (RuleGroup::Unspecified, Rule::YieldInInit), - (Pylint, "E0101") => (RuleGroup::Unspecified, Rule::ReturnInInit), - (Pylint, "E0116") => (RuleGroup::Unspecified, Rule::ContinueInFinally), - (Pylint, "E0117") => (RuleGroup::Unspecified, Rule::NonlocalWithoutBinding), - (Pylint, "E0118") => (RuleGroup::Unspecified, Rule::LoadBeforeGlobalDeclaration), - (Pylint, "E0241") => (RuleGroup::Unspecified, Rule::DuplicateBases), - (Pylint, "E0302") => (RuleGroup::Unspecified, Rule::UnexpectedSpecialMethodSignature), - (Pylint, "E0604") => (RuleGroup::Unspecified, Rule::InvalidAllObject), - (Pylint, "E0605") => (RuleGroup::Unspecified, Rule::InvalidAllFormat), - (Pylint, "E1142") => (RuleGroup::Unspecified, Rule::AwaitOutsideAsync), - (Pylint, "E1205") => (RuleGroup::Unspecified, Rule::LoggingTooManyArgs), - (Pylint, "E1206") => (RuleGroup::Unspecified, Rule::LoggingTooFewArgs), - (Pylint, "E1307") => (RuleGroup::Unspecified, Rule::BadStringFormatType), - (Pylint, "E1310") => (RuleGroup::Unspecified, Rule::BadStrStripCall), - (Pylint, "E1507") => (RuleGroup::Unspecified, Rule::InvalidEnvvarValue), - (Pylint, "E1700") => (RuleGroup::Unspecified, Rule::YieldFromInAsyncFunction), - (Pylint, "E2502") => (RuleGroup::Unspecified, Rule::BidirectionalUnicode), - (Pylint, "E2510") => (RuleGroup::Unspecified, Rule::InvalidCharacterBackspace), - (Pylint, "E2512") => (RuleGroup::Unspecified, Rule::InvalidCharacterSub), - (Pylint, "E2513") => (RuleGroup::Unspecified, Rule::InvalidCharacterEsc), - (Pylint, "E2514") => (RuleGroup::Unspecified, Rule::InvalidCharacterNul), - (Pylint, "E2515") => (RuleGroup::Unspecified, Rule::InvalidCharacterZeroWidthSpace), - (Pylint, "R0133") => (RuleGroup::Unspecified, Rule::ComparisonOfConstant), - (Pylint, "R0206") => (RuleGroup::Unspecified, Rule::PropertyWithParameters), - (Pylint, "R0402") => (RuleGroup::Unspecified, Rule::ManualFromImport), - (Pylint, "R0911") => (RuleGroup::Unspecified, Rule::TooManyReturnStatements), - (Pylint, "R0912") => (RuleGroup::Unspecified, Rule::TooManyBranches), - (Pylint, "R0913") => (RuleGroup::Unspecified, Rule::TooManyArguments), - (Pylint, "R0915") => (RuleGroup::Unspecified, Rule::TooManyStatements), - (Pylint, "R1701") => (RuleGroup::Unspecified, Rule::RepeatedIsinstanceCalls), - (Pylint, "R1711") => (RuleGroup::Unspecified, Rule::UselessReturn), - (Pylint, "R1722") => (RuleGroup::Unspecified, Rule::SysExitAlias), - (Pylint, "R2004") => (RuleGroup::Unspecified, Rule::MagicValueComparison), - (Pylint, "R5501") => (RuleGroup::Unspecified, Rule::CollapsibleElseIf), - (Pylint, "W0120") => (RuleGroup::Unspecified, Rule::UselessElseOnLoop), - (Pylint, "W0129") => (RuleGroup::Unspecified, Rule::AssertOnStringLiteral), - (Pylint, "W0131") => (RuleGroup::Unspecified, Rule::NamedExprWithoutContext), - (Pylint, "W0406") => (RuleGroup::Unspecified, Rule::ImportSelf), - (Pylint, "W0602") => (RuleGroup::Unspecified, Rule::GlobalVariableNotAssigned), - (Pylint, "W0603") => (RuleGroup::Unspecified, Rule::GlobalStatement), - (Pylint, "W0711") => (RuleGroup::Unspecified, Rule::BinaryOpException), - (Pylint, "W1508") => (RuleGroup::Unspecified, Rule::InvalidEnvvarDefault), - (Pylint, "W2901") => (RuleGroup::Unspecified, Rule::RedefinedLoopName), - (Pylint, "W3301") => (RuleGroup::Unspecified, Rule::NestedMinMax), - (Pylint, "W0130") => (RuleGroup::Unspecified, Rule::DuplicateValue), + (Pylint, "C0414") => (RuleGroup::Unspecified, rules::pylint::rules::UselessImportAlias), + (Pylint, "C1901") => (RuleGroup::Unspecified, rules::pylint::rules::CompareToEmptyString), + (Pylint, "C3002") => (RuleGroup::Unspecified, rules::pylint::rules::UnnecessaryDirectLambdaCall), + (Pylint, "C0208") => (RuleGroup::Unspecified, rules::pylint::rules::IterationOverSet), + (Pylint, "E0100") => (RuleGroup::Unspecified, rules::pylint::rules::YieldInInit), + (Pylint, "E0101") => (RuleGroup::Unspecified, rules::pylint::rules::ReturnInInit), + (Pylint, "E0116") => (RuleGroup::Unspecified, rules::pylint::rules::ContinueInFinally), + (Pylint, "E0117") => (RuleGroup::Unspecified, rules::pylint::rules::NonlocalWithoutBinding), + (Pylint, "E0118") => (RuleGroup::Unspecified, rules::pylint::rules::LoadBeforeGlobalDeclaration), + (Pylint, "E0241") => (RuleGroup::Unspecified, rules::pylint::rules::DuplicateBases), + (Pylint, "E0302") => (RuleGroup::Unspecified, rules::pylint::rules::UnexpectedSpecialMethodSignature), + (Pylint, "E0604") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidAllObject), + (Pylint, "E0605") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidAllFormat), + (Pylint, "E1142") => (RuleGroup::Unspecified, rules::pylint::rules::AwaitOutsideAsync), + (Pylint, "E1205") => (RuleGroup::Unspecified, rules::pylint::rules::LoggingTooManyArgs), + (Pylint, "E1206") => (RuleGroup::Unspecified, rules::pylint::rules::LoggingTooFewArgs), + (Pylint, "E1307") => (RuleGroup::Unspecified, rules::pylint::rules::BadStringFormatType), + (Pylint, "E1310") => (RuleGroup::Unspecified, rules::pylint::rules::BadStrStripCall), + (Pylint, "E1507") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidEnvvarValue), + (Pylint, "E1700") => (RuleGroup::Unspecified, rules::pylint::rules::YieldFromInAsyncFunction), + (Pylint, "E2502") => (RuleGroup::Unspecified, rules::pylint::rules::BidirectionalUnicode), + (Pylint, "E2510") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidCharacterBackspace), + (Pylint, "E2512") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidCharacterSub), + (Pylint, "E2513") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidCharacterEsc), + (Pylint, "E2514") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidCharacterNul), + (Pylint, "E2515") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidCharacterZeroWidthSpace), + (Pylint, "R0133") => (RuleGroup::Unspecified, rules::pylint::rules::ComparisonOfConstant), + (Pylint, "R0206") => (RuleGroup::Unspecified, rules::pylint::rules::PropertyWithParameters), + (Pylint, "R0402") => (RuleGroup::Unspecified, rules::pylint::rules::ManualFromImport), + (Pylint, "R0911") => (RuleGroup::Unspecified, rules::pylint::rules::TooManyReturnStatements), + (Pylint, "R0912") => (RuleGroup::Unspecified, rules::pylint::rules::TooManyBranches), + (Pylint, "R0913") => (RuleGroup::Unspecified, rules::pylint::rules::TooManyArguments), + (Pylint, "R0915") => (RuleGroup::Unspecified, rules::pylint::rules::TooManyStatements), + (Pylint, "R1701") => (RuleGroup::Unspecified, rules::pylint::rules::RepeatedIsinstanceCalls), + (Pylint, "R1711") => (RuleGroup::Unspecified, rules::pylint::rules::UselessReturn), + (Pylint, "R1722") => (RuleGroup::Unspecified, rules::pylint::rules::SysExitAlias), + (Pylint, "R2004") => (RuleGroup::Unspecified, rules::pylint::rules::MagicValueComparison), + (Pylint, "R5501") => (RuleGroup::Unspecified, rules::pylint::rules::CollapsibleElseIf), + (Pylint, "W0120") => (RuleGroup::Unspecified, rules::pylint::rules::UselessElseOnLoop), + (Pylint, "W0129") => (RuleGroup::Unspecified, rules::pylint::rules::AssertOnStringLiteral), + (Pylint, "W0130") => (RuleGroup::Unspecified, rules::pylint::rules::DuplicateValue), + (Pylint, "W0131") => (RuleGroup::Unspecified, rules::pylint::rules::NamedExprWithoutContext), + (Pylint, "W0406") => (RuleGroup::Unspecified, rules::pylint::rules::ImportSelf), + (Pylint, "W0602") => (RuleGroup::Unspecified, rules::pylint::rules::GlobalVariableNotAssigned), + (Pylint, "W0603") => (RuleGroup::Unspecified, rules::pylint::rules::GlobalStatement), + (Pylint, "W0711") => (RuleGroup::Unspecified, rules::pylint::rules::BinaryOpException), + (Pylint, "W1508") => (RuleGroup::Unspecified, rules::pylint::rules::InvalidEnvvarDefault), + (Pylint, "W2901") => (RuleGroup::Unspecified, rules::pylint::rules::RedefinedLoopName), + (Pylint, "W3301") => (RuleGroup::Unspecified, rules::pylint::rules::NestedMinMax), // flake8-async - (Flake8Async, "100") => (RuleGroup::Unspecified, Rule::BlockingHttpCallInAsyncFunction), - (Flake8Async, "101") => (RuleGroup::Unspecified, Rule::OpenSleepOrSubprocessInAsyncFunction), - (Flake8Async, "102") => (RuleGroup::Unspecified, Rule::BlockingOsCallInAsyncFunction), + (Flake8Async, "100") => (RuleGroup::Unspecified, rules::flake8_async::rules::BlockingHttpCallInAsyncFunction), + (Flake8Async, "101") => (RuleGroup::Unspecified, rules::flake8_async::rules::OpenSleepOrSubprocessInAsyncFunction), + (Flake8Async, "102") => (RuleGroup::Unspecified, rules::flake8_async::rules::BlockingOsCallInAsyncFunction), // flake8-builtins - (Flake8Builtins, "001") => (RuleGroup::Unspecified, Rule::BuiltinVariableShadowing), - (Flake8Builtins, "002") => (RuleGroup::Unspecified, Rule::BuiltinArgumentShadowing), - (Flake8Builtins, "003") => (RuleGroup::Unspecified, Rule::BuiltinAttributeShadowing), + (Flake8Builtins, "001") => (RuleGroup::Unspecified, rules::flake8_builtins::rules::BuiltinVariableShadowing), + (Flake8Builtins, "002") => (RuleGroup::Unspecified, rules::flake8_builtins::rules::BuiltinArgumentShadowing), + (Flake8Builtins, "003") => (RuleGroup::Unspecified, rules::flake8_builtins::rules::BuiltinAttributeShadowing), // flake8-bugbear - (Flake8Bugbear, "002") => (RuleGroup::Unspecified, Rule::UnaryPrefixIncrement), - (Flake8Bugbear, "003") => (RuleGroup::Unspecified, Rule::AssignmentToOsEnviron), - (Flake8Bugbear, "004") => (RuleGroup::Unspecified, Rule::UnreliableCallableCheck), - (Flake8Bugbear, "005") => (RuleGroup::Unspecified, Rule::StripWithMultiCharacters), - (Flake8Bugbear, "006") => (RuleGroup::Unspecified, Rule::MutableArgumentDefault), - (Flake8Bugbear, "007") => (RuleGroup::Unspecified, Rule::UnusedLoopControlVariable), - (Flake8Bugbear, "008") => (RuleGroup::Unspecified, Rule::FunctionCallInDefaultArgument), - (Flake8Bugbear, "009") => (RuleGroup::Unspecified, Rule::GetAttrWithConstant), - (Flake8Bugbear, "010") => (RuleGroup::Unspecified, Rule::SetAttrWithConstant), - (Flake8Bugbear, "011") => (RuleGroup::Unspecified, Rule::AssertFalse), - (Flake8Bugbear, "012") => (RuleGroup::Unspecified, Rule::JumpStatementInFinally), - (Flake8Bugbear, "013") => (RuleGroup::Unspecified, Rule::RedundantTupleInExceptionHandler), - (Flake8Bugbear, "014") => (RuleGroup::Unspecified, Rule::DuplicateHandlerException), - (Flake8Bugbear, "015") => (RuleGroup::Unspecified, Rule::UselessComparison), - (Flake8Bugbear, "016") => (RuleGroup::Unspecified, Rule::CannotRaiseLiteral), - (Flake8Bugbear, "017") => (RuleGroup::Unspecified, Rule::AssertRaisesException), - (Flake8Bugbear, "018") => (RuleGroup::Unspecified, Rule::UselessExpression), - (Flake8Bugbear, "019") => (RuleGroup::Unspecified, Rule::CachedInstanceMethod), - (Flake8Bugbear, "020") => (RuleGroup::Unspecified, Rule::LoopVariableOverridesIterator), - (Flake8Bugbear, "021") => (RuleGroup::Unspecified, Rule::FStringDocstring), - (Flake8Bugbear, "022") => (RuleGroup::Unspecified, Rule::UselessContextlibSuppress), - (Flake8Bugbear, "023") => (RuleGroup::Unspecified, Rule::FunctionUsesLoopVariable), - (Flake8Bugbear, "024") => (RuleGroup::Unspecified, Rule::AbstractBaseClassWithoutAbstractMethod), - (Flake8Bugbear, "025") => (RuleGroup::Unspecified, Rule::DuplicateTryBlockException), - (Flake8Bugbear, "026") => (RuleGroup::Unspecified, Rule::StarArgUnpackingAfterKeywordArg), - (Flake8Bugbear, "027") => (RuleGroup::Unspecified, Rule::EmptyMethodWithoutAbstractDecorator), - (Flake8Bugbear, "028") => (RuleGroup::Unspecified, Rule::NoExplicitStacklevel), - (Flake8Bugbear, "029") => (RuleGroup::Unspecified, Rule::ExceptWithEmptyTuple), - (Flake8Bugbear, "030") => (RuleGroup::Unspecified, Rule::ExceptWithNonExceptionClasses), - (Flake8Bugbear, "031") => (RuleGroup::Unspecified, Rule::ReuseOfGroupbyGenerator), - (Flake8Bugbear, "032") => (RuleGroup::Unspecified, Rule::UnintentionalTypeAnnotation), - (Flake8Bugbear, "904") => (RuleGroup::Unspecified, Rule::RaiseWithoutFromInsideExcept), - (Flake8Bugbear, "905") => (RuleGroup::Unspecified, Rule::ZipWithoutExplicitStrict), + (Flake8Bugbear, "002") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::UnaryPrefixIncrement), + (Flake8Bugbear, "003") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::AssignmentToOsEnviron), + (Flake8Bugbear, "004") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::UnreliableCallableCheck), + (Flake8Bugbear, "005") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::StripWithMultiCharacters), + (Flake8Bugbear, "006") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::MutableArgumentDefault), + (Flake8Bugbear, "007") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::UnusedLoopControlVariable), + (Flake8Bugbear, "008") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::FunctionCallInDefaultArgument), + (Flake8Bugbear, "009") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::GetAttrWithConstant), + (Flake8Bugbear, "010") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::SetAttrWithConstant), + (Flake8Bugbear, "011") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::AssertFalse), + (Flake8Bugbear, "012") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::JumpStatementInFinally), + (Flake8Bugbear, "013") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::RedundantTupleInExceptionHandler), + (Flake8Bugbear, "014") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::DuplicateHandlerException), + (Flake8Bugbear, "015") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::UselessComparison), + (Flake8Bugbear, "016") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::CannotRaiseLiteral), + (Flake8Bugbear, "017") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::AssertRaisesException), + (Flake8Bugbear, "018") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::UselessExpression), + (Flake8Bugbear, "019") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::CachedInstanceMethod), + (Flake8Bugbear, "020") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::LoopVariableOverridesIterator), + (Flake8Bugbear, "021") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::FStringDocstring), + (Flake8Bugbear, "022") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::UselessContextlibSuppress), + (Flake8Bugbear, "023") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::FunctionUsesLoopVariable), + (Flake8Bugbear, "024") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::AbstractBaseClassWithoutAbstractMethod), + (Flake8Bugbear, "025") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::DuplicateTryBlockException), + (Flake8Bugbear, "026") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::StarArgUnpackingAfterKeywordArg), + (Flake8Bugbear, "027") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::EmptyMethodWithoutAbstractDecorator), + (Flake8Bugbear, "028") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::NoExplicitStacklevel), + (Flake8Bugbear, "029") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::ExceptWithEmptyTuple), + (Flake8Bugbear, "030") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::ExceptWithNonExceptionClasses), + (Flake8Bugbear, "031") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::ReuseOfGroupbyGenerator), + (Flake8Bugbear, "032") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::UnintentionalTypeAnnotation), + (Flake8Bugbear, "904") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::RaiseWithoutFromInsideExcept), + (Flake8Bugbear, "905") => (RuleGroup::Unspecified, rules::flake8_bugbear::rules::ZipWithoutExplicitStrict), // flake8-blind-except - (Flake8BlindExcept, "001") => (RuleGroup::Unspecified, Rule::BlindExcept), + (Flake8BlindExcept, "001") => (RuleGroup::Unspecified, rules::flake8_blind_except::rules::BlindExcept), // flake8-comprehensions - (Flake8Comprehensions, "00") => (RuleGroup::Unspecified, Rule::UnnecessaryGeneratorList), - (Flake8Comprehensions, "01") => (RuleGroup::Unspecified, Rule::UnnecessaryGeneratorSet), - (Flake8Comprehensions, "02") => (RuleGroup::Unspecified, Rule::UnnecessaryGeneratorDict), - (Flake8Comprehensions, "03") => (RuleGroup::Unspecified, Rule::UnnecessaryListComprehensionSet), - (Flake8Comprehensions, "04") => (RuleGroup::Unspecified, Rule::UnnecessaryListComprehensionDict), - (Flake8Comprehensions, "05") => (RuleGroup::Unspecified, Rule::UnnecessaryLiteralSet), - (Flake8Comprehensions, "06") => (RuleGroup::Unspecified, Rule::UnnecessaryLiteralDict), - (Flake8Comprehensions, "08") => (RuleGroup::Unspecified, Rule::UnnecessaryCollectionCall), - (Flake8Comprehensions, "09") => (RuleGroup::Unspecified, Rule::UnnecessaryLiteralWithinTupleCall), - (Flake8Comprehensions, "10") => (RuleGroup::Unspecified, Rule::UnnecessaryLiteralWithinListCall), - (Flake8Comprehensions, "11") => (RuleGroup::Unspecified, Rule::UnnecessaryListCall), - (Flake8Comprehensions, "13") => (RuleGroup::Unspecified, Rule::UnnecessaryCallAroundSorted), - (Flake8Comprehensions, "14") => (RuleGroup::Unspecified, Rule::UnnecessaryDoubleCastOrProcess), - (Flake8Comprehensions, "15") => (RuleGroup::Unspecified, Rule::UnnecessarySubscriptReversal), - (Flake8Comprehensions, "16") => (RuleGroup::Unspecified, Rule::UnnecessaryComprehension), - (Flake8Comprehensions, "17") => (RuleGroup::Unspecified, Rule::UnnecessaryMap), - (Flake8Comprehensions, "18") => (RuleGroup::Unspecified, Rule::UnnecessaryLiteralWithinDictCall), - (Flake8Comprehensions, "19") => (RuleGroup::Unspecified, Rule::UnnecessaryComprehensionAnyAll), + (Flake8Comprehensions, "00") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryGeneratorList), + (Flake8Comprehensions, "01") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryGeneratorSet), + (Flake8Comprehensions, "02") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryGeneratorDict), + (Flake8Comprehensions, "03") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryListComprehensionSet), + (Flake8Comprehensions, "04") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryListComprehensionDict), + (Flake8Comprehensions, "05") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryLiteralSet), + (Flake8Comprehensions, "06") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryLiteralDict), + (Flake8Comprehensions, "08") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryCollectionCall), + (Flake8Comprehensions, "09") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryLiteralWithinTupleCall), + (Flake8Comprehensions, "10") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryLiteralWithinListCall), + (Flake8Comprehensions, "11") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryListCall), + (Flake8Comprehensions, "13") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryCallAroundSorted), + (Flake8Comprehensions, "14") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryDoubleCastOrProcess), + (Flake8Comprehensions, "15") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessarySubscriptReversal), + (Flake8Comprehensions, "16") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryComprehension), + (Flake8Comprehensions, "17") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryMap), + (Flake8Comprehensions, "18") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryLiteralWithinDictCall), + (Flake8Comprehensions, "19") => (RuleGroup::Unspecified, rules::flake8_comprehensions::rules::UnnecessaryComprehensionAnyAll), // flake8-debugger - (Flake8Debugger, "0") => (RuleGroup::Unspecified, Rule::Debugger), + (Flake8Debugger, "0") => (RuleGroup::Unspecified, rules::flake8_debugger::rules::Debugger), // mccabe - (McCabe, "1") => (RuleGroup::Unspecified, Rule::ComplexStructure), + (McCabe, "1") => (RuleGroup::Unspecified, rules::mccabe::rules::ComplexStructure), // flake8-tidy-imports - (Flake8TidyImports, "251") => (RuleGroup::Unspecified, Rule::BannedApi), - (Flake8TidyImports, "252") => (RuleGroup::Unspecified, Rule::RelativeImports), + (Flake8TidyImports, "251") => (RuleGroup::Unspecified, rules::flake8_tidy_imports::rules::BannedApi), + (Flake8TidyImports, "252") => (RuleGroup::Unspecified, rules::flake8_tidy_imports::rules::RelativeImports), // flake8-return - (Flake8Return, "501") => (RuleGroup::Unspecified, Rule::UnnecessaryReturnNone), - (Flake8Return, "502") => (RuleGroup::Unspecified, Rule::ImplicitReturnValue), - (Flake8Return, "503") => (RuleGroup::Unspecified, Rule::ImplicitReturn), - (Flake8Return, "504") => (RuleGroup::Unspecified, Rule::UnnecessaryAssign), - (Flake8Return, "505") => (RuleGroup::Unspecified, Rule::SuperfluousElseReturn), - (Flake8Return, "506") => (RuleGroup::Unspecified, Rule::SuperfluousElseRaise), - (Flake8Return, "507") => (RuleGroup::Unspecified, Rule::SuperfluousElseContinue), - (Flake8Return, "508") => (RuleGroup::Unspecified, Rule::SuperfluousElseBreak), + (Flake8Return, "501") => (RuleGroup::Unspecified, rules::flake8_return::rules::UnnecessaryReturnNone), + (Flake8Return, "502") => (RuleGroup::Unspecified, rules::flake8_return::rules::ImplicitReturnValue), + (Flake8Return, "503") => (RuleGroup::Unspecified, rules::flake8_return::rules::ImplicitReturn), + (Flake8Return, "504") => (RuleGroup::Unspecified, rules::flake8_return::rules::UnnecessaryAssign), + (Flake8Return, "505") => (RuleGroup::Unspecified, rules::flake8_return::rules::SuperfluousElseReturn), + (Flake8Return, "506") => (RuleGroup::Unspecified, rules::flake8_return::rules::SuperfluousElseRaise), + (Flake8Return, "507") => (RuleGroup::Unspecified, rules::flake8_return::rules::SuperfluousElseContinue), + (Flake8Return, "508") => (RuleGroup::Unspecified, rules::flake8_return::rules::SuperfluousElseBreak), // flake8-gettext - (Flake8GetText, "001") => (RuleGroup::Unspecified, Rule::FStringInGetTextFuncCall), - (Flake8GetText, "002") => (RuleGroup::Unspecified, Rule::FormatInGetTextFuncCall), - (Flake8GetText, "003") => (RuleGroup::Unspecified, Rule::PrintfInGetTextFuncCall), + (Flake8GetText, "001") => (RuleGroup::Unspecified, rules::flake8_gettext::rules::FStringInGetTextFuncCall), + (Flake8GetText, "002") => (RuleGroup::Unspecified, rules::flake8_gettext::rules::FormatInGetTextFuncCall), + (Flake8GetText, "003") => (RuleGroup::Unspecified, rules::flake8_gettext::rules::PrintfInGetTextFuncCall), // flake8-implicit-str-concat - (Flake8ImplicitStrConcat, "001") => (RuleGroup::Unspecified, Rule::SingleLineImplicitStringConcatenation), - (Flake8ImplicitStrConcat, "002") => (RuleGroup::Unspecified, Rule::MultiLineImplicitStringConcatenation), - (Flake8ImplicitStrConcat, "003") => (RuleGroup::Unspecified, Rule::ExplicitStringConcatenation), + (Flake8ImplicitStrConcat, "001") => (RuleGroup::Unspecified, rules::flake8_implicit_str_concat::rules::SingleLineImplicitStringConcatenation), + (Flake8ImplicitStrConcat, "002") => (RuleGroup::Unspecified, rules::flake8_implicit_str_concat::rules::MultiLineImplicitStringConcatenation), + (Flake8ImplicitStrConcat, "003") => (RuleGroup::Unspecified, rules::flake8_implicit_str_concat::rules::ExplicitStringConcatenation), // flake8-print - (Flake8Print, "1") => (RuleGroup::Unspecified, Rule::Print), - (Flake8Print, "3") => (RuleGroup::Unspecified, Rule::PPrint), + (Flake8Print, "1") => (RuleGroup::Unspecified, rules::flake8_print::rules::Print), + (Flake8Print, "3") => (RuleGroup::Unspecified, rules::flake8_print::rules::PPrint), // flake8-quotes - (Flake8Quotes, "000") => (RuleGroup::Unspecified, Rule::BadQuotesInlineString), - (Flake8Quotes, "001") => (RuleGroup::Unspecified, Rule::BadQuotesMultilineString), - (Flake8Quotes, "002") => (RuleGroup::Unspecified, Rule::BadQuotesDocstring), - (Flake8Quotes, "003") => (RuleGroup::Unspecified, Rule::AvoidableEscapedQuote), + (Flake8Quotes, "000") => (RuleGroup::Unspecified, rules::flake8_quotes::rules::BadQuotesInlineString), + (Flake8Quotes, "001") => (RuleGroup::Unspecified, rules::flake8_quotes::rules::BadQuotesMultilineString), + (Flake8Quotes, "002") => (RuleGroup::Unspecified, rules::flake8_quotes::rules::BadQuotesDocstring), + (Flake8Quotes, "003") => (RuleGroup::Unspecified, rules::flake8_quotes::rules::AvoidableEscapedQuote), // flake8-annotations - (Flake8Annotations, "001") => (RuleGroup::Unspecified, Rule::MissingTypeFunctionArgument), - (Flake8Annotations, "002") => (RuleGroup::Unspecified, Rule::MissingTypeArgs), - (Flake8Annotations, "003") => (RuleGroup::Unspecified, Rule::MissingTypeKwargs), - (Flake8Annotations, "101") => (RuleGroup::Unspecified, Rule::MissingTypeSelf), - (Flake8Annotations, "102") => (RuleGroup::Unspecified, Rule::MissingTypeCls), - (Flake8Annotations, "201") => (RuleGroup::Unspecified, Rule::MissingReturnTypeUndocumentedPublicFunction), - (Flake8Annotations, "202") => (RuleGroup::Unspecified, Rule::MissingReturnTypePrivateFunction), - (Flake8Annotations, "204") => (RuleGroup::Unspecified, Rule::MissingReturnTypeSpecialMethod), - (Flake8Annotations, "205") => (RuleGroup::Unspecified, Rule::MissingReturnTypeStaticMethod), - (Flake8Annotations, "206") => (RuleGroup::Unspecified, Rule::MissingReturnTypeClassMethod), - (Flake8Annotations, "401") => (RuleGroup::Unspecified, Rule::AnyType), + (Flake8Annotations, "001") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingTypeFunctionArgument), + (Flake8Annotations, "002") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingTypeArgs), + (Flake8Annotations, "003") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingTypeKwargs), + (Flake8Annotations, "101") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingTypeSelf), + (Flake8Annotations, "102") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingTypeCls), + (Flake8Annotations, "201") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingReturnTypeUndocumentedPublicFunction), + (Flake8Annotations, "202") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingReturnTypePrivateFunction), + (Flake8Annotations, "204") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingReturnTypeSpecialMethod), + (Flake8Annotations, "205") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingReturnTypeStaticMethod), + (Flake8Annotations, "206") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::MissingReturnTypeClassMethod), + (Flake8Annotations, "401") => (RuleGroup::Unspecified, rules::flake8_annotations::rules::AnyType), // flake8-future-annotations - (Flake8FutureAnnotations, "100") => (RuleGroup::Unspecified, Rule::FutureRewritableTypeAnnotation), - (Flake8FutureAnnotations, "102") => (RuleGroup::Unspecified, Rule::FutureRequiredTypeAnnotation), + (Flake8FutureAnnotations, "100") => (RuleGroup::Unspecified, rules::flake8_future_annotations::rules::FutureRewritableTypeAnnotation), + (Flake8FutureAnnotations, "102") => (RuleGroup::Unspecified, rules::flake8_future_annotations::rules::FutureRequiredTypeAnnotation), // flake8-2020 - (Flake82020, "101") => (RuleGroup::Unspecified, Rule::SysVersionSlice3), - (Flake82020, "102") => (RuleGroup::Unspecified, Rule::SysVersion2), - (Flake82020, "103") => (RuleGroup::Unspecified, Rule::SysVersionCmpStr3), - (Flake82020, "201") => (RuleGroup::Unspecified, Rule::SysVersionInfo0Eq3), - (Flake82020, "202") => (RuleGroup::Unspecified, Rule::SixPY3), - (Flake82020, "203") => (RuleGroup::Unspecified, Rule::SysVersionInfo1CmpInt), - (Flake82020, "204") => (RuleGroup::Unspecified, Rule::SysVersionInfoMinorCmpInt), - (Flake82020, "301") => (RuleGroup::Unspecified, Rule::SysVersion0), - (Flake82020, "302") => (RuleGroup::Unspecified, Rule::SysVersionCmpStr10), - (Flake82020, "303") => (RuleGroup::Unspecified, Rule::SysVersionSlice1), + (Flake82020, "101") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersionSlice3), + (Flake82020, "102") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersion2), + (Flake82020, "103") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersionCmpStr3), + (Flake82020, "201") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersionInfo0Eq3), + (Flake82020, "202") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SixPY3), + (Flake82020, "203") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersionInfo1CmpInt), + (Flake82020, "204") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersionInfoMinorCmpInt), + (Flake82020, "301") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersion0), + (Flake82020, "302") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersionCmpStr10), + (Flake82020, "303") => (RuleGroup::Unspecified, rules::flake8_2020::rules::SysVersionSlice1), // flake8-simplify - (Flake8Simplify, "101") => (RuleGroup::Unspecified, Rule::DuplicateIsinstanceCall), - (Flake8Simplify, "102") => (RuleGroup::Unspecified, Rule::CollapsibleIf), - (Flake8Simplify, "103") => (RuleGroup::Unspecified, Rule::NeedlessBool), - (Flake8Simplify, "105") => (RuleGroup::Unspecified, Rule::SuppressibleException), - (Flake8Simplify, "107") => (RuleGroup::Unspecified, Rule::ReturnInTryExceptFinally), - (Flake8Simplify, "108") => (RuleGroup::Unspecified, Rule::IfElseBlockInsteadOfIfExp), - (Flake8Simplify, "109") => (RuleGroup::Unspecified, Rule::CompareWithTuple), - (Flake8Simplify, "110") => (RuleGroup::Unspecified, Rule::ReimplementedBuiltin), - (Flake8Simplify, "112") => (RuleGroup::Unspecified, Rule::UncapitalizedEnvironmentVariables), - (Flake8Simplify, "114") => (RuleGroup::Unspecified, Rule::IfWithSameArms), - (Flake8Simplify, "115") => (RuleGroup::Unspecified, Rule::OpenFileWithContextHandler), - (Flake8Simplify, "116") => (RuleGroup::Unspecified, Rule::IfElseBlockInsteadOfDictLookup), - (Flake8Simplify, "117") => (RuleGroup::Unspecified, Rule::MultipleWithStatements), - (Flake8Simplify, "118") => (RuleGroup::Unspecified, Rule::InDictKeys), - (Flake8Simplify, "201") => (RuleGroup::Unspecified, Rule::NegateEqualOp), - (Flake8Simplify, "202") => (RuleGroup::Unspecified, Rule::NegateNotEqualOp), - (Flake8Simplify, "208") => (RuleGroup::Unspecified, Rule::DoubleNegation), - (Flake8Simplify, "210") => (RuleGroup::Unspecified, Rule::IfExprWithTrueFalse), - (Flake8Simplify, "211") => (RuleGroup::Unspecified, Rule::IfExprWithFalseTrue), - (Flake8Simplify, "212") => (RuleGroup::Unspecified, Rule::IfExprWithTwistedArms), - (Flake8Simplify, "220") => (RuleGroup::Unspecified, Rule::ExprAndNotExpr), - (Flake8Simplify, "221") => (RuleGroup::Unspecified, Rule::ExprOrNotExpr), - (Flake8Simplify, "222") => (RuleGroup::Unspecified, Rule::ExprOrTrue), - (Flake8Simplify, "223") => (RuleGroup::Unspecified, Rule::ExprAndFalse), - (Flake8Simplify, "300") => (RuleGroup::Unspecified, Rule::YodaConditions), - (Flake8Simplify, "401") => (RuleGroup::Unspecified, Rule::IfElseBlockInsteadOfDictGet), - (Flake8Simplify, "910") => (RuleGroup::Unspecified, Rule::DictGetWithNoneDefault), + (Flake8Simplify, "101") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::DuplicateIsinstanceCall), + (Flake8Simplify, "102") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::CollapsibleIf), + (Flake8Simplify, "103") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::NeedlessBool), + (Flake8Simplify, "105") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::SuppressibleException), + (Flake8Simplify, "107") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::ReturnInTryExceptFinally), + (Flake8Simplify, "108") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::IfElseBlockInsteadOfIfExp), + (Flake8Simplify, "109") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::CompareWithTuple), + (Flake8Simplify, "110") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::ReimplementedBuiltin), + (Flake8Simplify, "112") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::UncapitalizedEnvironmentVariables), + (Flake8Simplify, "114") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::IfWithSameArms), + (Flake8Simplify, "115") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::OpenFileWithContextHandler), + (Flake8Simplify, "116") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::IfElseBlockInsteadOfDictLookup), + (Flake8Simplify, "117") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::MultipleWithStatements), + (Flake8Simplify, "118") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::InDictKeys), + (Flake8Simplify, "201") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::NegateEqualOp), + (Flake8Simplify, "202") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::NegateNotEqualOp), + (Flake8Simplify, "208") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::DoubleNegation), + (Flake8Simplify, "210") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::IfExprWithTrueFalse), + (Flake8Simplify, "211") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::IfExprWithFalseTrue), + (Flake8Simplify, "212") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::IfExprWithTwistedArms), + (Flake8Simplify, "220") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::ExprAndNotExpr), + (Flake8Simplify, "221") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::ExprOrNotExpr), + (Flake8Simplify, "222") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::ExprOrTrue), + (Flake8Simplify, "223") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::ExprAndFalse), + (Flake8Simplify, "300") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::YodaConditions), + (Flake8Simplify, "401") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::IfElseBlockInsteadOfDictGet), + (Flake8Simplify, "910") => (RuleGroup::Unspecified, rules::flake8_simplify::rules::DictGetWithNoneDefault), // pyupgrade - (Pyupgrade, "001") => (RuleGroup::Unspecified, Rule::UselessMetaclassType), - (Pyupgrade, "003") => (RuleGroup::Unspecified, Rule::TypeOfPrimitive), - (Pyupgrade, "004") => (RuleGroup::Unspecified, Rule::UselessObjectInheritance), - (Pyupgrade, "005") => (RuleGroup::Unspecified, Rule::DeprecatedUnittestAlias), - (Pyupgrade, "006") => (RuleGroup::Unspecified, Rule::NonPEP585Annotation), - (Pyupgrade, "007") => (RuleGroup::Unspecified, Rule::NonPEP604Annotation), - (Pyupgrade, "008") => (RuleGroup::Unspecified, Rule::SuperCallWithParameters), - (Pyupgrade, "009") => (RuleGroup::Unspecified, Rule::UTF8EncodingDeclaration), - (Pyupgrade, "010") => (RuleGroup::Unspecified, Rule::UnnecessaryFutureImport), - (Pyupgrade, "011") => (RuleGroup::Unspecified, Rule::LRUCacheWithoutParameters), - (Pyupgrade, "012") => (RuleGroup::Unspecified, Rule::UnnecessaryEncodeUTF8), - (Pyupgrade, "013") => (RuleGroup::Unspecified, Rule::ConvertTypedDictFunctionalToClass), - (Pyupgrade, "014") => (RuleGroup::Unspecified, Rule::ConvertNamedTupleFunctionalToClass), - (Pyupgrade, "015") => (RuleGroup::Unspecified, Rule::RedundantOpenModes), - (Pyupgrade, "017") => (RuleGroup::Unspecified, Rule::DatetimeTimezoneUTC), - (Pyupgrade, "018") => (RuleGroup::Unspecified, Rule::NativeLiterals), - (Pyupgrade, "019") => (RuleGroup::Unspecified, Rule::TypingTextStrAlias), - (Pyupgrade, "020") => (RuleGroup::Unspecified, Rule::OpenAlias), - (Pyupgrade, "021") => (RuleGroup::Unspecified, Rule::ReplaceUniversalNewlines), - (Pyupgrade, "022") => (RuleGroup::Unspecified, Rule::ReplaceStdoutStderr), - (Pyupgrade, "023") => (RuleGroup::Unspecified, Rule::DeprecatedCElementTree), - (Pyupgrade, "024") => (RuleGroup::Unspecified, Rule::OSErrorAlias), - (Pyupgrade, "025") => (RuleGroup::Unspecified, Rule::UnicodeKindPrefix), - (Pyupgrade, "026") => (RuleGroup::Unspecified, Rule::DeprecatedMockImport), - (Pyupgrade, "027") => (RuleGroup::Unspecified, Rule::UnpackedListComprehension), - (Pyupgrade, "028") => (RuleGroup::Unspecified, Rule::YieldInForLoop), - (Pyupgrade, "029") => (RuleGroup::Unspecified, Rule::UnnecessaryBuiltinImport), - (Pyupgrade, "030") => (RuleGroup::Unspecified, Rule::FormatLiterals), - (Pyupgrade, "031") => (RuleGroup::Unspecified, Rule::PrintfStringFormatting), - (Pyupgrade, "032") => (RuleGroup::Unspecified, Rule::FString), - (Pyupgrade, "033") => (RuleGroup::Unspecified, Rule::LRUCacheWithMaxsizeNone), - (Pyupgrade, "034") => (RuleGroup::Unspecified, Rule::ExtraneousParentheses), - (Pyupgrade, "035") => (RuleGroup::Unspecified, Rule::DeprecatedImport), - (Pyupgrade, "036") => (RuleGroup::Unspecified, Rule::OutdatedVersionBlock), - (Pyupgrade, "037") => (RuleGroup::Unspecified, Rule::QuotedAnnotation), - (Pyupgrade, "038") => (RuleGroup::Unspecified, Rule::NonPEP604Isinstance), + (Pyupgrade, "001") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UselessMetaclassType), + (Pyupgrade, "003") => (RuleGroup::Unspecified, rules::pyupgrade::rules::TypeOfPrimitive), + (Pyupgrade, "004") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UselessObjectInheritance), + (Pyupgrade, "005") => (RuleGroup::Unspecified, rules::pyupgrade::rules::DeprecatedUnittestAlias), + (Pyupgrade, "006") => (RuleGroup::Unspecified, rules::pyupgrade::rules::NonPEP585Annotation), + (Pyupgrade, "007") => (RuleGroup::Unspecified, rules::pyupgrade::rules::NonPEP604Annotation), + (Pyupgrade, "008") => (RuleGroup::Unspecified, rules::pyupgrade::rules::SuperCallWithParameters), + (Pyupgrade, "009") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UTF8EncodingDeclaration), + (Pyupgrade, "010") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UnnecessaryFutureImport), + (Pyupgrade, "011") => (RuleGroup::Unspecified, rules::pyupgrade::rules::LRUCacheWithoutParameters), + (Pyupgrade, "012") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UnnecessaryEncodeUTF8), + (Pyupgrade, "013") => (RuleGroup::Unspecified, rules::pyupgrade::rules::ConvertTypedDictFunctionalToClass), + (Pyupgrade, "014") => (RuleGroup::Unspecified, rules::pyupgrade::rules::ConvertNamedTupleFunctionalToClass), + (Pyupgrade, "015") => (RuleGroup::Unspecified, rules::pyupgrade::rules::RedundantOpenModes), + (Pyupgrade, "017") => (RuleGroup::Unspecified, rules::pyupgrade::rules::DatetimeTimezoneUTC), + (Pyupgrade, "018") => (RuleGroup::Unspecified, rules::pyupgrade::rules::NativeLiterals), + (Pyupgrade, "019") => (RuleGroup::Unspecified, rules::pyupgrade::rules::TypingTextStrAlias), + (Pyupgrade, "020") => (RuleGroup::Unspecified, rules::pyupgrade::rules::OpenAlias), + (Pyupgrade, "021") => (RuleGroup::Unspecified, rules::pyupgrade::rules::ReplaceUniversalNewlines), + (Pyupgrade, "022") => (RuleGroup::Unspecified, rules::pyupgrade::rules::ReplaceStdoutStderr), + (Pyupgrade, "023") => (RuleGroup::Unspecified, rules::pyupgrade::rules::DeprecatedCElementTree), + (Pyupgrade, "024") => (RuleGroup::Unspecified, rules::pyupgrade::rules::OSErrorAlias), + (Pyupgrade, "025") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UnicodeKindPrefix), + (Pyupgrade, "026") => (RuleGroup::Unspecified, rules::pyupgrade::rules::DeprecatedMockImport), + (Pyupgrade, "027") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UnpackedListComprehension), + (Pyupgrade, "028") => (RuleGroup::Unspecified, rules::pyupgrade::rules::YieldInForLoop), + (Pyupgrade, "029") => (RuleGroup::Unspecified, rules::pyupgrade::rules::UnnecessaryBuiltinImport), + (Pyupgrade, "030") => (RuleGroup::Unspecified, rules::pyupgrade::rules::FormatLiterals), + (Pyupgrade, "031") => (RuleGroup::Unspecified, rules::pyupgrade::rules::PrintfStringFormatting), + (Pyupgrade, "032") => (RuleGroup::Unspecified, rules::pyupgrade::rules::FString), + (Pyupgrade, "033") => (RuleGroup::Unspecified, rules::pyupgrade::rules::LRUCacheWithMaxsizeNone), + (Pyupgrade, "034") => (RuleGroup::Unspecified, rules::pyupgrade::rules::ExtraneousParentheses), + (Pyupgrade, "035") => (RuleGroup::Unspecified, rules::pyupgrade::rules::DeprecatedImport), + (Pyupgrade, "036") => (RuleGroup::Unspecified, rules::pyupgrade::rules::OutdatedVersionBlock), + (Pyupgrade, "037") => (RuleGroup::Unspecified, rules::pyupgrade::rules::QuotedAnnotation), + (Pyupgrade, "038") => (RuleGroup::Unspecified, rules::pyupgrade::rules::NonPEP604Isinstance), // pydocstyle - (Pydocstyle, "100") => (RuleGroup::Unspecified, Rule::UndocumentedPublicModule), - (Pydocstyle, "101") => (RuleGroup::Unspecified, Rule::UndocumentedPublicClass), - (Pydocstyle, "102") => (RuleGroup::Unspecified, Rule::UndocumentedPublicMethod), - (Pydocstyle, "103") => (RuleGroup::Unspecified, Rule::UndocumentedPublicFunction), - (Pydocstyle, "104") => (RuleGroup::Unspecified, Rule::UndocumentedPublicPackage), - (Pydocstyle, "105") => (RuleGroup::Unspecified, Rule::UndocumentedMagicMethod), - (Pydocstyle, "106") => (RuleGroup::Unspecified, Rule::UndocumentedPublicNestedClass), - (Pydocstyle, "107") => (RuleGroup::Unspecified, Rule::UndocumentedPublicInit), - (Pydocstyle, "200") => (RuleGroup::Unspecified, Rule::FitsOnOneLine), - (Pydocstyle, "201") => (RuleGroup::Unspecified, Rule::NoBlankLineBeforeFunction), - (Pydocstyle, "202") => (RuleGroup::Unspecified, Rule::NoBlankLineAfterFunction), - (Pydocstyle, "203") => (RuleGroup::Unspecified, Rule::OneBlankLineBeforeClass), - (Pydocstyle, "204") => (RuleGroup::Unspecified, Rule::OneBlankLineAfterClass), - (Pydocstyle, "205") => (RuleGroup::Unspecified, Rule::BlankLineAfterSummary), - (Pydocstyle, "206") => (RuleGroup::Unspecified, Rule::IndentWithSpaces), - (Pydocstyle, "207") => (RuleGroup::Unspecified, Rule::UnderIndentation), - (Pydocstyle, "208") => (RuleGroup::Unspecified, Rule::OverIndentation), - (Pydocstyle, "209") => (RuleGroup::Unspecified, Rule::NewLineAfterLastParagraph), - (Pydocstyle, "210") => (RuleGroup::Unspecified, Rule::SurroundingWhitespace), - (Pydocstyle, "211") => (RuleGroup::Unspecified, Rule::BlankLineBeforeClass), - (Pydocstyle, "212") => (RuleGroup::Unspecified, Rule::MultiLineSummaryFirstLine), - (Pydocstyle, "213") => (RuleGroup::Unspecified, Rule::MultiLineSummarySecondLine), - (Pydocstyle, "214") => (RuleGroup::Unspecified, Rule::SectionNotOverIndented), - (Pydocstyle, "215") => (RuleGroup::Unspecified, Rule::SectionUnderlineNotOverIndented), - (Pydocstyle, "300") => (RuleGroup::Unspecified, Rule::TripleSingleQuotes), - (Pydocstyle, "301") => (RuleGroup::Unspecified, Rule::EscapeSequenceInDocstring), - (Pydocstyle, "400") => (RuleGroup::Unspecified, Rule::EndsInPeriod), - (Pydocstyle, "401") => (RuleGroup::Unspecified, Rule::NonImperativeMood), - (Pydocstyle, "402") => (RuleGroup::Unspecified, Rule::NoSignature), - (Pydocstyle, "403") => (RuleGroup::Unspecified, Rule::FirstLineCapitalized), - (Pydocstyle, "404") => (RuleGroup::Unspecified, Rule::DocstringStartsWithThis), - (Pydocstyle, "405") => (RuleGroup::Unspecified, Rule::CapitalizeSectionName), - (Pydocstyle, "406") => (RuleGroup::Unspecified, Rule::NewLineAfterSectionName), - (Pydocstyle, "407") => (RuleGroup::Unspecified, Rule::DashedUnderlineAfterSection), - (Pydocstyle, "408") => (RuleGroup::Unspecified, Rule::SectionUnderlineAfterName), - (Pydocstyle, "409") => (RuleGroup::Unspecified, Rule::SectionUnderlineMatchesSectionLength), - (Pydocstyle, "410") => (RuleGroup::Unspecified, Rule::NoBlankLineAfterSection), - (Pydocstyle, "411") => (RuleGroup::Unspecified, Rule::NoBlankLineBeforeSection), - (Pydocstyle, "412") => (RuleGroup::Unspecified, Rule::BlankLinesBetweenHeaderAndContent), - (Pydocstyle, "413") => (RuleGroup::Unspecified, Rule::BlankLineAfterLastSection), - (Pydocstyle, "414") => (RuleGroup::Unspecified, Rule::EmptyDocstringSection), - (Pydocstyle, "415") => (RuleGroup::Unspecified, Rule::EndsInPunctuation), - (Pydocstyle, "416") => (RuleGroup::Unspecified, Rule::SectionNameEndsInColon), - (Pydocstyle, "417") => (RuleGroup::Unspecified, Rule::UndocumentedParam), - (Pydocstyle, "418") => (RuleGroup::Unspecified, Rule::OverloadWithDocstring), - (Pydocstyle, "419") => (RuleGroup::Unspecified, Rule::EmptyDocstring), + (Pydocstyle, "100") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedPublicModule), + (Pydocstyle, "101") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedPublicClass), + (Pydocstyle, "102") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedPublicMethod), + (Pydocstyle, "103") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedPublicFunction), + (Pydocstyle, "104") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedPublicPackage), + (Pydocstyle, "105") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedMagicMethod), + (Pydocstyle, "106") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedPublicNestedClass), + (Pydocstyle, "107") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedPublicInit), + (Pydocstyle, "200") => (RuleGroup::Unspecified, rules::pydocstyle::rules::FitsOnOneLine), + (Pydocstyle, "201") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NoBlankLineBeforeFunction), + (Pydocstyle, "202") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NoBlankLineAfterFunction), + (Pydocstyle, "203") => (RuleGroup::Unspecified, rules::pydocstyle::rules::OneBlankLineBeforeClass), + (Pydocstyle, "204") => (RuleGroup::Unspecified, rules::pydocstyle::rules::OneBlankLineAfterClass), + (Pydocstyle, "205") => (RuleGroup::Unspecified, rules::pydocstyle::rules::BlankLineAfterSummary), + (Pydocstyle, "206") => (RuleGroup::Unspecified, rules::pydocstyle::rules::IndentWithSpaces), + (Pydocstyle, "207") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UnderIndentation), + (Pydocstyle, "208") => (RuleGroup::Unspecified, rules::pydocstyle::rules::OverIndentation), + (Pydocstyle, "209") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NewLineAfterLastParagraph), + (Pydocstyle, "210") => (RuleGroup::Unspecified, rules::pydocstyle::rules::SurroundingWhitespace), + (Pydocstyle, "211") => (RuleGroup::Unspecified, rules::pydocstyle::rules::BlankLineBeforeClass), + (Pydocstyle, "212") => (RuleGroup::Unspecified, rules::pydocstyle::rules::MultiLineSummaryFirstLine), + (Pydocstyle, "213") => (RuleGroup::Unspecified, rules::pydocstyle::rules::MultiLineSummarySecondLine), + (Pydocstyle, "214") => (RuleGroup::Unspecified, rules::pydocstyle::rules::SectionNotOverIndented), + (Pydocstyle, "215") => (RuleGroup::Unspecified, rules::pydocstyle::rules::SectionUnderlineNotOverIndented), + (Pydocstyle, "300") => (RuleGroup::Unspecified, rules::pydocstyle::rules::TripleSingleQuotes), + (Pydocstyle, "301") => (RuleGroup::Unspecified, rules::pydocstyle::rules::EscapeSequenceInDocstring), + (Pydocstyle, "400") => (RuleGroup::Unspecified, rules::pydocstyle::rules::EndsInPeriod), + (Pydocstyle, "401") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NonImperativeMood), + (Pydocstyle, "402") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NoSignature), + (Pydocstyle, "403") => (RuleGroup::Unspecified, rules::pydocstyle::rules::FirstLineCapitalized), + (Pydocstyle, "404") => (RuleGroup::Unspecified, rules::pydocstyle::rules::DocstringStartsWithThis), + (Pydocstyle, "405") => (RuleGroup::Unspecified, rules::pydocstyle::rules::CapitalizeSectionName), + (Pydocstyle, "406") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NewLineAfterSectionName), + (Pydocstyle, "407") => (RuleGroup::Unspecified, rules::pydocstyle::rules::DashedUnderlineAfterSection), + (Pydocstyle, "408") => (RuleGroup::Unspecified, rules::pydocstyle::rules::SectionUnderlineAfterName), + (Pydocstyle, "409") => (RuleGroup::Unspecified, rules::pydocstyle::rules::SectionUnderlineMatchesSectionLength), + (Pydocstyle, "410") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NoBlankLineAfterSection), + (Pydocstyle, "411") => (RuleGroup::Unspecified, rules::pydocstyle::rules::NoBlankLineBeforeSection), + (Pydocstyle, "412") => (RuleGroup::Unspecified, rules::pydocstyle::rules::BlankLinesBetweenHeaderAndContent), + (Pydocstyle, "413") => (RuleGroup::Unspecified, rules::pydocstyle::rules::BlankLineAfterLastSection), + (Pydocstyle, "414") => (RuleGroup::Unspecified, rules::pydocstyle::rules::EmptyDocstringSection), + (Pydocstyle, "415") => (RuleGroup::Unspecified, rules::pydocstyle::rules::EndsInPunctuation), + (Pydocstyle, "416") => (RuleGroup::Unspecified, rules::pydocstyle::rules::SectionNameEndsInColon), + (Pydocstyle, "417") => (RuleGroup::Unspecified, rules::pydocstyle::rules::UndocumentedParam), + (Pydocstyle, "418") => (RuleGroup::Unspecified, rules::pydocstyle::rules::OverloadWithDocstring), + (Pydocstyle, "419") => (RuleGroup::Unspecified, rules::pydocstyle::rules::EmptyDocstring), // pep8-naming - (PEP8Naming, "801") => (RuleGroup::Unspecified, Rule::InvalidClassName), - (PEP8Naming, "802") => (RuleGroup::Unspecified, Rule::InvalidFunctionName), - (PEP8Naming, "803") => (RuleGroup::Unspecified, Rule::InvalidArgumentName), - (PEP8Naming, "804") => (RuleGroup::Unspecified, Rule::InvalidFirstArgumentNameForClassMethod), - (PEP8Naming, "805") => (RuleGroup::Unspecified, Rule::InvalidFirstArgumentNameForMethod), - (PEP8Naming, "806") => (RuleGroup::Unspecified, Rule::NonLowercaseVariableInFunction), - (PEP8Naming, "807") => (RuleGroup::Unspecified, Rule::DunderFunctionName), - (PEP8Naming, "811") => (RuleGroup::Unspecified, Rule::ConstantImportedAsNonConstant), - (PEP8Naming, "812") => (RuleGroup::Unspecified, Rule::LowercaseImportedAsNonLowercase), - (PEP8Naming, "813") => (RuleGroup::Unspecified, Rule::CamelcaseImportedAsLowercase), - (PEP8Naming, "814") => (RuleGroup::Unspecified, Rule::CamelcaseImportedAsConstant), - (PEP8Naming, "815") => (RuleGroup::Unspecified, Rule::MixedCaseVariableInClassScope), - (PEP8Naming, "816") => (RuleGroup::Unspecified, Rule::MixedCaseVariableInGlobalScope), - (PEP8Naming, "817") => (RuleGroup::Unspecified, Rule::CamelcaseImportedAsAcronym), - (PEP8Naming, "818") => (RuleGroup::Unspecified, Rule::ErrorSuffixOnExceptionName), - (PEP8Naming, "999") => (RuleGroup::Unspecified, Rule::InvalidModuleName), + (PEP8Naming, "801") => (RuleGroup::Unspecified, rules::pep8_naming::rules::InvalidClassName), + (PEP8Naming, "802") => (RuleGroup::Unspecified, rules::pep8_naming::rules::InvalidFunctionName), + (PEP8Naming, "803") => (RuleGroup::Unspecified, rules::pep8_naming::rules::InvalidArgumentName), + (PEP8Naming, "804") => (RuleGroup::Unspecified, rules::pep8_naming::rules::InvalidFirstArgumentNameForClassMethod), + (PEP8Naming, "805") => (RuleGroup::Unspecified, rules::pep8_naming::rules::InvalidFirstArgumentNameForMethod), + (PEP8Naming, "806") => (RuleGroup::Unspecified, rules::pep8_naming::rules::NonLowercaseVariableInFunction), + (PEP8Naming, "807") => (RuleGroup::Unspecified, rules::pep8_naming::rules::DunderFunctionName), + (PEP8Naming, "811") => (RuleGroup::Unspecified, rules::pep8_naming::rules::ConstantImportedAsNonConstant), + (PEP8Naming, "812") => (RuleGroup::Unspecified, rules::pep8_naming::rules::LowercaseImportedAsNonLowercase), + (PEP8Naming, "813") => (RuleGroup::Unspecified, rules::pep8_naming::rules::CamelcaseImportedAsLowercase), + (PEP8Naming, "814") => (RuleGroup::Unspecified, rules::pep8_naming::rules::CamelcaseImportedAsConstant), + (PEP8Naming, "815") => (RuleGroup::Unspecified, rules::pep8_naming::rules::MixedCaseVariableInClassScope), + (PEP8Naming, "816") => (RuleGroup::Unspecified, rules::pep8_naming::rules::MixedCaseVariableInGlobalScope), + (PEP8Naming, "817") => (RuleGroup::Unspecified, rules::pep8_naming::rules::CamelcaseImportedAsAcronym), + (PEP8Naming, "818") => (RuleGroup::Unspecified, rules::pep8_naming::rules::ErrorSuffixOnExceptionName), + (PEP8Naming, "999") => (RuleGroup::Unspecified, rules::pep8_naming::rules::InvalidModuleName), // isort - (Isort, "001") => (RuleGroup::Unspecified, Rule::UnsortedImports), - (Isort, "002") => (RuleGroup::Unspecified, Rule::MissingRequiredImport), + (Isort, "001") => (RuleGroup::Unspecified, rules::isort::rules::UnsortedImports), + (Isort, "002") => (RuleGroup::Unspecified, rules::isort::rules::MissingRequiredImport), // eradicate - (Eradicate, "001") => (RuleGroup::Unspecified, Rule::CommentedOutCode), + (Eradicate, "001") => (RuleGroup::Unspecified, rules::eradicate::rules::CommentedOutCode), // flake8-bandit - (Flake8Bandit, "101") => (RuleGroup::Unspecified, Rule::Assert), - (Flake8Bandit, "102") => (RuleGroup::Unspecified, Rule::ExecBuiltin), - (Flake8Bandit, "103") => (RuleGroup::Unspecified, Rule::BadFilePermissions), - (Flake8Bandit, "104") => (RuleGroup::Unspecified, Rule::HardcodedBindAllInterfaces), - (Flake8Bandit, "105") => (RuleGroup::Unspecified, Rule::HardcodedPasswordString), - (Flake8Bandit, "106") => (RuleGroup::Unspecified, Rule::HardcodedPasswordFuncArg), - (Flake8Bandit, "107") => (RuleGroup::Unspecified, Rule::HardcodedPasswordDefault), - (Flake8Bandit, "108") => (RuleGroup::Unspecified, Rule::HardcodedTempFile), - (Flake8Bandit, "110") => (RuleGroup::Unspecified, Rule::TryExceptPass), - (Flake8Bandit, "112") => (RuleGroup::Unspecified, Rule::TryExceptContinue), - (Flake8Bandit, "113") => (RuleGroup::Unspecified, Rule::RequestWithoutTimeout), - (Flake8Bandit, "301") => (RuleGroup::Unspecified, Rule::SuspiciousPickleUsage), - (Flake8Bandit, "302") => (RuleGroup::Unspecified, Rule::SuspiciousMarshalUsage), - (Flake8Bandit, "303") => (RuleGroup::Unspecified, Rule::SuspiciousInsecureHashUsage), - (Flake8Bandit, "304") => (RuleGroup::Unspecified, Rule::SuspiciousInsecureCipherUsage), - (Flake8Bandit, "305") => (RuleGroup::Unspecified, Rule::SuspiciousInsecureCipherModeUsage), - (Flake8Bandit, "306") => (RuleGroup::Unspecified, Rule::SuspiciousMktempUsage), - (Flake8Bandit, "307") => (RuleGroup::Unspecified, Rule::SuspiciousEvalUsage), - (Flake8Bandit, "308") => (RuleGroup::Unspecified, Rule::SuspiciousMarkSafeUsage), - (Flake8Bandit, "310") => (RuleGroup::Unspecified, Rule::SuspiciousURLOpenUsage), - (Flake8Bandit, "311") => (RuleGroup::Unspecified, Rule::SuspiciousNonCryptographicRandomUsage), - (Flake8Bandit, "312") => (RuleGroup::Unspecified, Rule::SuspiciousTelnetUsage), - (Flake8Bandit, "313") => (RuleGroup::Unspecified, Rule::SuspiciousXMLCElementTreeUsage), - (Flake8Bandit, "314") => (RuleGroup::Unspecified, Rule::SuspiciousXMLElementTreeUsage), - (Flake8Bandit, "315") => (RuleGroup::Unspecified, Rule::SuspiciousXMLExpatReaderUsage), - (Flake8Bandit, "316") => (RuleGroup::Unspecified, Rule::SuspiciousXMLExpatBuilderUsage), - (Flake8Bandit, "317") => (RuleGroup::Unspecified, Rule::SuspiciousXMLSaxUsage), - (Flake8Bandit, "318") => (RuleGroup::Unspecified, Rule::SuspiciousXMLMiniDOMUsage), - (Flake8Bandit, "319") => (RuleGroup::Unspecified, Rule::SuspiciousXMLPullDOMUsage), - (Flake8Bandit, "320") => (RuleGroup::Unspecified, Rule::SuspiciousXMLETreeUsage), - (Flake8Bandit, "321") => (RuleGroup::Unspecified, Rule::SuspiciousFTPLibUsage), - (Flake8Bandit, "323") => (RuleGroup::Unspecified, Rule::SuspiciousUnverifiedContextUsage), - (Flake8Bandit, "324") => (RuleGroup::Unspecified, Rule::HashlibInsecureHashFunction), - (Flake8Bandit, "501") => (RuleGroup::Unspecified, Rule::RequestWithNoCertValidation), - (Flake8Bandit, "506") => (RuleGroup::Unspecified, Rule::UnsafeYAMLLoad), - (Flake8Bandit, "508") => (RuleGroup::Unspecified, Rule::SnmpInsecureVersion), - (Flake8Bandit, "509") => (RuleGroup::Unspecified, Rule::SnmpWeakCryptography), - (Flake8Bandit, "601") => (RuleGroup::Unspecified, Rule::ParamikoCall), - (Flake8Bandit, "602") => (RuleGroup::Unspecified, Rule::SubprocessPopenWithShellEqualsTrue), - (Flake8Bandit, "603") => (RuleGroup::Unspecified, Rule::SubprocessWithoutShellEqualsTrue), - (Flake8Bandit, "604") => (RuleGroup::Unspecified, Rule::CallWithShellEqualsTrue), - (Flake8Bandit, "605") => (RuleGroup::Unspecified, Rule::StartProcessWithAShell), - (Flake8Bandit, "606") => (RuleGroup::Unspecified, Rule::StartProcessWithNoShell), - (Flake8Bandit, "607") => (RuleGroup::Unspecified, Rule::StartProcessWithPartialPath), - (Flake8Bandit, "608") => (RuleGroup::Unspecified, Rule::HardcodedSQLExpression), - (Flake8Bandit, "612") => (RuleGroup::Unspecified, Rule::LoggingConfigInsecureListen), - (Flake8Bandit, "701") => (RuleGroup::Unspecified, Rule::Jinja2AutoescapeFalse), + (Flake8Bandit, "101") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::Assert), + (Flake8Bandit, "102") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::ExecBuiltin), + (Flake8Bandit, "103") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::BadFilePermissions), + (Flake8Bandit, "104") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::HardcodedBindAllInterfaces), + (Flake8Bandit, "105") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::HardcodedPasswordString), + (Flake8Bandit, "106") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::HardcodedPasswordFuncArg), + (Flake8Bandit, "107") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::HardcodedPasswordDefault), + (Flake8Bandit, "108") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::HardcodedTempFile), + (Flake8Bandit, "110") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::TryExceptPass), + (Flake8Bandit, "112") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::TryExceptContinue), + (Flake8Bandit, "113") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::RequestWithoutTimeout), + (Flake8Bandit, "301") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousPickleUsage), + (Flake8Bandit, "302") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousMarshalUsage), + (Flake8Bandit, "303") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousInsecureHashUsage), + (Flake8Bandit, "304") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousInsecureCipherUsage), + (Flake8Bandit, "305") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousInsecureCipherModeUsage), + (Flake8Bandit, "306") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousMktempUsage), + (Flake8Bandit, "307") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousEvalUsage), + (Flake8Bandit, "308") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousMarkSafeUsage), + (Flake8Bandit, "310") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousURLOpenUsage), + (Flake8Bandit, "311") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousNonCryptographicRandomUsage), + (Flake8Bandit, "312") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousTelnetUsage), + (Flake8Bandit, "313") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLCElementTreeUsage), + (Flake8Bandit, "314") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLElementTreeUsage), + (Flake8Bandit, "315") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLExpatReaderUsage), + (Flake8Bandit, "316") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLExpatBuilderUsage), + (Flake8Bandit, "317") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLSaxUsage), + (Flake8Bandit, "318") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLMiniDOMUsage), + (Flake8Bandit, "319") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLPullDOMUsage), + (Flake8Bandit, "320") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousXMLETreeUsage), + (Flake8Bandit, "321") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousFTPLibUsage), + (Flake8Bandit, "323") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SuspiciousUnverifiedContextUsage), + (Flake8Bandit, "324") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::HashlibInsecureHashFunction), + (Flake8Bandit, "501") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::RequestWithNoCertValidation), + (Flake8Bandit, "506") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::UnsafeYAMLLoad), + (Flake8Bandit, "508") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SnmpInsecureVersion), + (Flake8Bandit, "509") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SnmpWeakCryptography), + (Flake8Bandit, "601") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::ParamikoCall), + (Flake8Bandit, "602") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SubprocessPopenWithShellEqualsTrue), + (Flake8Bandit, "603") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::SubprocessWithoutShellEqualsTrue), + (Flake8Bandit, "604") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::CallWithShellEqualsTrue), + (Flake8Bandit, "605") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::StartProcessWithAShell), + (Flake8Bandit, "606") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::StartProcessWithNoShell), + (Flake8Bandit, "607") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::StartProcessWithPartialPath), + (Flake8Bandit, "608") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::HardcodedSQLExpression), + (Flake8Bandit, "612") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::LoggingConfigInsecureListen), + (Flake8Bandit, "701") => (RuleGroup::Unspecified, rules::flake8_bandit::rules::Jinja2AutoescapeFalse), // flake8-boolean-trap - (Flake8BooleanTrap, "001") => (RuleGroup::Unspecified, Rule::BooleanPositionalArgInFunctionDefinition), - (Flake8BooleanTrap, "002") => (RuleGroup::Unspecified, Rule::BooleanDefaultValueInFunctionDefinition), - (Flake8BooleanTrap, "003") => (RuleGroup::Unspecified, Rule::BooleanPositionalValueInFunctionCall), + (Flake8BooleanTrap, "001") => (RuleGroup::Unspecified, rules::flake8_boolean_trap::rules::BooleanPositionalArgInFunctionDefinition), + (Flake8BooleanTrap, "002") => (RuleGroup::Unspecified, rules::flake8_boolean_trap::rules::BooleanDefaultValueInFunctionDefinition), + (Flake8BooleanTrap, "003") => (RuleGroup::Unspecified, rules::flake8_boolean_trap::rules::BooleanPositionalValueInFunctionCall), // flake8-unused-arguments - (Flake8UnusedArguments, "001") => (RuleGroup::Unspecified, Rule::UnusedFunctionArgument), - (Flake8UnusedArguments, "002") => (RuleGroup::Unspecified, Rule::UnusedMethodArgument), - (Flake8UnusedArguments, "003") => (RuleGroup::Unspecified, Rule::UnusedClassMethodArgument), - (Flake8UnusedArguments, "004") => (RuleGroup::Unspecified, Rule::UnusedStaticMethodArgument), - (Flake8UnusedArguments, "005") => (RuleGroup::Unspecified, Rule::UnusedLambdaArgument), + (Flake8UnusedArguments, "001") => (RuleGroup::Unspecified, rules::flake8_unused_arguments::rules::UnusedFunctionArgument), + (Flake8UnusedArguments, "002") => (RuleGroup::Unspecified, rules::flake8_unused_arguments::rules::UnusedMethodArgument), + (Flake8UnusedArguments, "003") => (RuleGroup::Unspecified, rules::flake8_unused_arguments::rules::UnusedClassMethodArgument), + (Flake8UnusedArguments, "004") => (RuleGroup::Unspecified, rules::flake8_unused_arguments::rules::UnusedStaticMethodArgument), + (Flake8UnusedArguments, "005") => (RuleGroup::Unspecified, rules::flake8_unused_arguments::rules::UnusedLambdaArgument), // flake8-import-conventions - (Flake8ImportConventions, "001") => (RuleGroup::Unspecified, Rule::UnconventionalImportAlias), - (Flake8ImportConventions, "002") => (RuleGroup::Unspecified, Rule::BannedImportAlias), - (Flake8ImportConventions, "003") => (RuleGroup::Unspecified, Rule::BannedImportFrom), + (Flake8ImportConventions, "001") => (RuleGroup::Unspecified, rules::flake8_import_conventions::rules::UnconventionalImportAlias), + (Flake8ImportConventions, "002") => (RuleGroup::Unspecified, rules::flake8_import_conventions::rules::BannedImportAlias), + (Flake8ImportConventions, "003") => (RuleGroup::Unspecified, rules::flake8_import_conventions::rules::BannedImportFrom), // flake8-datetimez - (Flake8Datetimez, "001") => (RuleGroup::Unspecified, Rule::CallDatetimeWithoutTzinfo), - (Flake8Datetimez, "002") => (RuleGroup::Unspecified, Rule::CallDatetimeToday), - (Flake8Datetimez, "003") => (RuleGroup::Unspecified, Rule::CallDatetimeUtcnow), - (Flake8Datetimez, "004") => (RuleGroup::Unspecified, Rule::CallDatetimeUtcfromtimestamp), - (Flake8Datetimez, "005") => (RuleGroup::Unspecified, Rule::CallDatetimeNowWithoutTzinfo), - (Flake8Datetimez, "006") => (RuleGroup::Unspecified, Rule::CallDatetimeFromtimestamp), - (Flake8Datetimez, "007") => (RuleGroup::Unspecified, Rule::CallDatetimeStrptimeWithoutZone), - (Flake8Datetimez, "011") => (RuleGroup::Unspecified, Rule::CallDateToday), - (Flake8Datetimez, "012") => (RuleGroup::Unspecified, Rule::CallDateFromtimestamp), + (Flake8Datetimez, "001") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDatetimeWithoutTzinfo), + (Flake8Datetimez, "002") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDatetimeToday), + (Flake8Datetimez, "003") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDatetimeUtcnow), + (Flake8Datetimez, "004") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDatetimeUtcfromtimestamp), + (Flake8Datetimez, "005") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDatetimeNowWithoutTzinfo), + (Flake8Datetimez, "006") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDatetimeFromtimestamp), + (Flake8Datetimez, "007") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDatetimeStrptimeWithoutZone), + (Flake8Datetimez, "011") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDateToday), + (Flake8Datetimez, "012") => (RuleGroup::Unspecified, rules::flake8_datetimez::rules::CallDateFromtimestamp), // pygrep-hooks - (PygrepHooks, "001") => (RuleGroup::Unspecified, Rule::Eval), - (PygrepHooks, "002") => (RuleGroup::Unspecified, Rule::DeprecatedLogWarn), - (PygrepHooks, "003") => (RuleGroup::Unspecified, Rule::BlanketTypeIgnore), - (PygrepHooks, "004") => (RuleGroup::Unspecified, Rule::BlanketNOQA), - (PygrepHooks, "005") => (RuleGroup::Unspecified, Rule::InvalidMockAccess), + (PygrepHooks, "001") => (RuleGroup::Unspecified, rules::pygrep_hooks::rules::Eval), + (PygrepHooks, "002") => (RuleGroup::Unspecified, rules::pygrep_hooks::rules::DeprecatedLogWarn), + (PygrepHooks, "003") => (RuleGroup::Unspecified, rules::pygrep_hooks::rules::BlanketTypeIgnore), + (PygrepHooks, "004") => (RuleGroup::Unspecified, rules::pygrep_hooks::rules::BlanketNOQA), + (PygrepHooks, "005") => (RuleGroup::Unspecified, rules::pygrep_hooks::rules::InvalidMockAccess), // pandas-vet - (PandasVet, "002") => (RuleGroup::Unspecified, Rule::PandasUseOfInplaceArgument), - (PandasVet, "003") => (RuleGroup::Unspecified, Rule::PandasUseOfDotIsNull), - (PandasVet, "004") => (RuleGroup::Unspecified, Rule::PandasUseOfDotNotNull), - (PandasVet, "007") => (RuleGroup::Unspecified, Rule::PandasUseOfDotIx), - (PandasVet, "008") => (RuleGroup::Unspecified, Rule::PandasUseOfDotAt), - (PandasVet, "009") => (RuleGroup::Unspecified, Rule::PandasUseOfDotIat), - (PandasVet, "010") => (RuleGroup::Unspecified, Rule::PandasUseOfDotPivotOrUnstack), - (PandasVet, "011") => (RuleGroup::Unspecified, Rule::PandasUseOfDotValues), - (PandasVet, "012") => (RuleGroup::Unspecified, Rule::PandasUseOfDotReadTable), - (PandasVet, "013") => (RuleGroup::Unspecified, Rule::PandasUseOfDotStack), - (PandasVet, "015") => (RuleGroup::Unspecified, Rule::PandasUseOfPdMerge), - (PandasVet, "901") => (RuleGroup::Unspecified, Rule::PandasDfVariableName), + (PandasVet, "002") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfInplaceArgument), + (PandasVet, "003") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotIsNull), + (PandasVet, "004") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotNotNull), + (PandasVet, "007") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotIx), + (PandasVet, "008") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotAt), + (PandasVet, "009") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotIat), + (PandasVet, "010") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotPivotOrUnstack), + (PandasVet, "011") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotValues), + (PandasVet, "012") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotReadTable), + (PandasVet, "013") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfDotStack), + (PandasVet, "015") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasUseOfPdMerge), + (PandasVet, "901") => (RuleGroup::Unspecified, rules::pandas_vet::rules::PandasDfVariableName), // flake8-errmsg - (Flake8ErrMsg, "101") => (RuleGroup::Unspecified, Rule::RawStringInException), - (Flake8ErrMsg, "102") => (RuleGroup::Unspecified, Rule::FStringInException), - (Flake8ErrMsg, "103") => (RuleGroup::Unspecified, Rule::DotFormatInException), + (Flake8ErrMsg, "101") => (RuleGroup::Unspecified, rules::flake8_errmsg::rules::RawStringInException), + (Flake8ErrMsg, "102") => (RuleGroup::Unspecified, rules::flake8_errmsg::rules::FStringInException), + (Flake8ErrMsg, "103") => (RuleGroup::Unspecified, rules::flake8_errmsg::rules::DotFormatInException), // flake8-pyi - (Flake8Pyi, "001") => (RuleGroup::Unspecified, Rule::UnprefixedTypeParam), - (Flake8Pyi, "006") => (RuleGroup::Unspecified, Rule::BadVersionInfoComparison), - (Flake8Pyi, "007") => (RuleGroup::Unspecified, Rule::UnrecognizedPlatformCheck), - (Flake8Pyi, "008") => (RuleGroup::Unspecified, Rule::UnrecognizedPlatformName), - (Flake8Pyi, "009") => (RuleGroup::Unspecified, Rule::PassStatementStubBody), - (Flake8Pyi, "010") => (RuleGroup::Unspecified, Rule::NonEmptyStubBody), - (Flake8Pyi, "011") => (RuleGroup::Unspecified, Rule::TypedArgumentDefaultInStub), - (Flake8Pyi, "012") => (RuleGroup::Unspecified, Rule::PassInClassBody), - (Flake8Pyi, "013") => (RuleGroup::Unspecified, Rule::EllipsisInNonEmptyClassBody), - (Flake8Pyi, "014") => (RuleGroup::Unspecified, Rule::ArgumentDefaultInStub), - (Flake8Pyi, "015") => (RuleGroup::Unspecified, Rule::AssignmentDefaultInStub), - (Flake8Pyi, "016") => (RuleGroup::Unspecified, Rule::DuplicateUnionMember), - (Flake8Pyi, "020") => (RuleGroup::Unspecified, Rule::QuotedAnnotationInStub), - (Flake8Pyi, "021") => (RuleGroup::Unspecified, Rule::DocstringInStub), - (Flake8Pyi, "024") => (RuleGroup::Unspecified, Rule::CollectionsNamedTuple), - (Flake8Pyi, "025") => (RuleGroup::Unspecified, Rule::UnaliasedCollectionsAbcSetImport), - (Flake8Pyi, "032") => (RuleGroup::Unspecified, Rule::AnyEqNeAnnotation), - (Flake8Pyi, "033") => (RuleGroup::Unspecified, Rule::TypeCommentInStub), - (Flake8Pyi, "034") => (RuleGroup::Unspecified, Rule::NonSelfReturnType), - (Flake8Pyi, "042") => (RuleGroup::Unspecified, Rule::SnakeCaseTypeAlias), - (Flake8Pyi, "043") => (RuleGroup::Unspecified, Rule::TSuffixedTypeAlias), - (Flake8Pyi, "045") => (RuleGroup::Unspecified, Rule::IterMethodReturnIterable), - (Flake8Pyi, "048") => (RuleGroup::Unspecified, Rule::StubBodyMultipleStatements), - (Flake8Pyi, "052") => (RuleGroup::Unspecified, Rule::UnannotatedAssignmentInStub), - (Flake8Pyi, "054") => (RuleGroup::Unspecified, Rule::NumericLiteralTooLong), - (Flake8Pyi, "053") => (RuleGroup::Unspecified, Rule::StringOrBytesTooLong), + (Flake8Pyi, "001") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::UnprefixedTypeParam), + (Flake8Pyi, "006") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::BadVersionInfoComparison), + (Flake8Pyi, "007") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::UnrecognizedPlatformCheck), + (Flake8Pyi, "008") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::UnrecognizedPlatformName), + (Flake8Pyi, "009") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::PassStatementStubBody), + (Flake8Pyi, "010") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::NonEmptyStubBody), + (Flake8Pyi, "011") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::TypedArgumentDefaultInStub), + (Flake8Pyi, "012") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::PassInClassBody), + (Flake8Pyi, "013") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::EllipsisInNonEmptyClassBody), + (Flake8Pyi, "014") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::ArgumentDefaultInStub), + (Flake8Pyi, "015") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::AssignmentDefaultInStub), + (Flake8Pyi, "016") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::DuplicateUnionMember), + (Flake8Pyi, "020") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::QuotedAnnotationInStub), + (Flake8Pyi, "021") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::DocstringInStub), + (Flake8Pyi, "024") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::CollectionsNamedTuple), + (Flake8Pyi, "025") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::UnaliasedCollectionsAbcSetImport), + (Flake8Pyi, "032") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::AnyEqNeAnnotation), + (Flake8Pyi, "033") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::TypeCommentInStub), + (Flake8Pyi, "034") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::NonSelfReturnType), + (Flake8Pyi, "042") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::SnakeCaseTypeAlias), + (Flake8Pyi, "043") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::TSuffixedTypeAlias), + (Flake8Pyi, "045") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::IterMethodReturnIterable), + (Flake8Pyi, "048") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::StubBodyMultipleStatements), + (Flake8Pyi, "052") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::UnannotatedAssignmentInStub), + (Flake8Pyi, "054") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::NumericLiteralTooLong), + (Flake8Pyi, "053") => (RuleGroup::Unspecified, rules::flake8_pyi::rules::StringOrBytesTooLong), // flake8-pytest-style - (Flake8PytestStyle, "001") => (RuleGroup::Unspecified, Rule::PytestFixtureIncorrectParenthesesStyle), - (Flake8PytestStyle, "002") => (RuleGroup::Unspecified, Rule::PytestFixturePositionalArgs), - (Flake8PytestStyle, "003") => (RuleGroup::Unspecified, Rule::PytestExtraneousScopeFunction), - (Flake8PytestStyle, "004") => (RuleGroup::Unspecified, Rule::PytestMissingFixtureNameUnderscore), - (Flake8PytestStyle, "005") => (RuleGroup::Unspecified, Rule::PytestIncorrectFixtureNameUnderscore), - (Flake8PytestStyle, "006") => (RuleGroup::Unspecified, Rule::PytestParametrizeNamesWrongType), - (Flake8PytestStyle, "007") => (RuleGroup::Unspecified, Rule::PytestParametrizeValuesWrongType), - (Flake8PytestStyle, "008") => (RuleGroup::Unspecified, Rule::PytestPatchWithLambda), - (Flake8PytestStyle, "009") => (RuleGroup::Unspecified, Rule::PytestUnittestAssertion), - (Flake8PytestStyle, "010") => (RuleGroup::Unspecified, Rule::PytestRaisesWithoutException), - (Flake8PytestStyle, "011") => (RuleGroup::Unspecified, Rule::PytestRaisesTooBroad), - (Flake8PytestStyle, "012") => (RuleGroup::Unspecified, Rule::PytestRaisesWithMultipleStatements), - (Flake8PytestStyle, "013") => (RuleGroup::Unspecified, Rule::PytestIncorrectPytestImport), - (Flake8PytestStyle, "015") => (RuleGroup::Unspecified, Rule::PytestAssertAlwaysFalse), - (Flake8PytestStyle, "016") => (RuleGroup::Unspecified, Rule::PytestFailWithoutMessage), - (Flake8PytestStyle, "017") => (RuleGroup::Unspecified, Rule::PytestAssertInExcept), - (Flake8PytestStyle, "018") => (RuleGroup::Unspecified, Rule::PytestCompositeAssertion), - (Flake8PytestStyle, "019") => (RuleGroup::Unspecified, Rule::PytestFixtureParamWithoutValue), - (Flake8PytestStyle, "020") => (RuleGroup::Unspecified, Rule::PytestDeprecatedYieldFixture), - (Flake8PytestStyle, "021") => (RuleGroup::Unspecified, Rule::PytestFixtureFinalizerCallback), - (Flake8PytestStyle, "022") => (RuleGroup::Unspecified, Rule::PytestUselessYieldFixture), - (Flake8PytestStyle, "023") => (RuleGroup::Unspecified, Rule::PytestIncorrectMarkParenthesesStyle), - (Flake8PytestStyle, "024") => (RuleGroup::Unspecified, Rule::PytestUnnecessaryAsyncioMarkOnFixture), - (Flake8PytestStyle, "025") => (RuleGroup::Unspecified, Rule::PytestErroneousUseFixturesOnFixture), - (Flake8PytestStyle, "026") => (RuleGroup::Unspecified, Rule::PytestUseFixturesWithoutParameters), + (Flake8PytestStyle, "001") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestFixtureIncorrectParenthesesStyle), + (Flake8PytestStyle, "002") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestFixturePositionalArgs), + (Flake8PytestStyle, "003") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestExtraneousScopeFunction), + (Flake8PytestStyle, "004") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestMissingFixtureNameUnderscore), + (Flake8PytestStyle, "005") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestIncorrectFixtureNameUnderscore), + (Flake8PytestStyle, "006") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestParametrizeNamesWrongType), + (Flake8PytestStyle, "007") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestParametrizeValuesWrongType), + (Flake8PytestStyle, "008") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestPatchWithLambda), + (Flake8PytestStyle, "009") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestUnittestAssertion), + (Flake8PytestStyle, "010") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestRaisesWithoutException), + (Flake8PytestStyle, "011") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestRaisesTooBroad), + (Flake8PytestStyle, "012") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestRaisesWithMultipleStatements), + (Flake8PytestStyle, "013") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestIncorrectPytestImport), + (Flake8PytestStyle, "015") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestAssertAlwaysFalse), + (Flake8PytestStyle, "016") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestFailWithoutMessage), + (Flake8PytestStyle, "017") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestAssertInExcept), + (Flake8PytestStyle, "018") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestCompositeAssertion), + (Flake8PytestStyle, "019") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestFixtureParamWithoutValue), + (Flake8PytestStyle, "020") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestDeprecatedYieldFixture), + (Flake8PytestStyle, "021") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestFixtureFinalizerCallback), + (Flake8PytestStyle, "022") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestUselessYieldFixture), + (Flake8PytestStyle, "023") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestIncorrectMarkParenthesesStyle), + (Flake8PytestStyle, "024") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestUnnecessaryAsyncioMarkOnFixture), + (Flake8PytestStyle, "025") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestErroneousUseFixturesOnFixture), + (Flake8PytestStyle, "026") => (RuleGroup::Unspecified, rules::flake8_pytest_style::rules::PytestUseFixturesWithoutParameters), // flake8-pie - (Flake8Pie, "790") => (RuleGroup::Unspecified, Rule::UnnecessaryPass), - (Flake8Pie, "794") => (RuleGroup::Unspecified, Rule::DuplicateClassFieldDefinition), - (Flake8Pie, "796") => (RuleGroup::Unspecified, Rule::NonUniqueEnums), - (Flake8Pie, "800") => (RuleGroup::Unspecified, Rule::UnnecessarySpread), - (Flake8Pie, "804") => (RuleGroup::Unspecified, Rule::UnnecessaryDictKwargs), - (Flake8Pie, "807") => (RuleGroup::Unspecified, Rule::ReimplementedListBuiltin), - (Flake8Pie, "810") => (RuleGroup::Unspecified, Rule::MultipleStartsEndsWith), + (Flake8Pie, "790") => (RuleGroup::Unspecified, rules::flake8_pie::rules::UnnecessaryPass), + (Flake8Pie, "794") => (RuleGroup::Unspecified, rules::flake8_pie::rules::DuplicateClassFieldDefinition), + (Flake8Pie, "796") => (RuleGroup::Unspecified, rules::flake8_pie::rules::NonUniqueEnums), + (Flake8Pie, "800") => (RuleGroup::Unspecified, rules::flake8_pie::rules::UnnecessarySpread), + (Flake8Pie, "804") => (RuleGroup::Unspecified, rules::flake8_pie::rules::UnnecessaryDictKwargs), + (Flake8Pie, "807") => (RuleGroup::Unspecified, rules::flake8_pie::rules::ReimplementedListBuiltin), + (Flake8Pie, "810") => (RuleGroup::Unspecified, rules::flake8_pie::rules::MultipleStartsEndsWith), // flake8-commas - (Flake8Commas, "812") => (RuleGroup::Unspecified, Rule::MissingTrailingComma), - (Flake8Commas, "818") => (RuleGroup::Unspecified, Rule::TrailingCommaOnBareTuple), - (Flake8Commas, "819") => (RuleGroup::Unspecified, Rule::ProhibitedTrailingComma), + (Flake8Commas, "812") => (RuleGroup::Unspecified, rules::flake8_commas::rules::MissingTrailingComma), + (Flake8Commas, "818") => (RuleGroup::Unspecified, rules::flake8_commas::rules::TrailingCommaOnBareTuple), + (Flake8Commas, "819") => (RuleGroup::Unspecified, rules::flake8_commas::rules::ProhibitedTrailingComma), // flake8-no-pep420 - (Flake8NoPep420, "001") => (RuleGroup::Unspecified, Rule::ImplicitNamespacePackage), + (Flake8NoPep420, "001") => (RuleGroup::Unspecified, rules::flake8_no_pep420::rules::ImplicitNamespacePackage), // flake8-executable - (Flake8Executable, "001") => (RuleGroup::Unspecified, Rule::ShebangNotExecutable), - (Flake8Executable, "002") => (RuleGroup::Unspecified, Rule::ShebangMissingExecutableFile), - (Flake8Executable, "003") => (RuleGroup::Unspecified, Rule::ShebangMissingPython), - (Flake8Executable, "004") => (RuleGroup::Unspecified, Rule::ShebangLeadingWhitespace), - (Flake8Executable, "005") => (RuleGroup::Unspecified, Rule::ShebangNotFirstLine), + (Flake8Executable, "001") => (RuleGroup::Unspecified, rules::flake8_executable::rules::ShebangNotExecutable), + (Flake8Executable, "002") => (RuleGroup::Unspecified, rules::flake8_executable::rules::ShebangMissingExecutableFile), + (Flake8Executable, "003") => (RuleGroup::Unspecified, rules::flake8_executable::rules::ShebangMissingPython), + (Flake8Executable, "004") => (RuleGroup::Unspecified, rules::flake8_executable::rules::ShebangLeadingWhitespace), + (Flake8Executable, "005") => (RuleGroup::Unspecified, rules::flake8_executable::rules::ShebangNotFirstLine), // flake8-type-checking - (Flake8TypeChecking, "001") => (RuleGroup::Unspecified, Rule::TypingOnlyFirstPartyImport), - (Flake8TypeChecking, "002") => (RuleGroup::Unspecified, Rule::TypingOnlyThirdPartyImport), - (Flake8TypeChecking, "003") => (RuleGroup::Unspecified, Rule::TypingOnlyStandardLibraryImport), - (Flake8TypeChecking, "004") => (RuleGroup::Unspecified, Rule::RuntimeImportInTypeCheckingBlock), - (Flake8TypeChecking, "005") => (RuleGroup::Unspecified, Rule::EmptyTypeCheckingBlock), + (Flake8TypeChecking, "001") => (RuleGroup::Unspecified, rules::flake8_type_checking::rules::TypingOnlyFirstPartyImport), + (Flake8TypeChecking, "002") => (RuleGroup::Unspecified, rules::flake8_type_checking::rules::TypingOnlyThirdPartyImport), + (Flake8TypeChecking, "003") => (RuleGroup::Unspecified, rules::flake8_type_checking::rules::TypingOnlyStandardLibraryImport), + (Flake8TypeChecking, "004") => (RuleGroup::Unspecified, rules::flake8_type_checking::rules::RuntimeImportInTypeCheckingBlock), + (Flake8TypeChecking, "005") => (RuleGroup::Unspecified, rules::flake8_type_checking::rules::EmptyTypeCheckingBlock), // tryceratops - (Tryceratops, "002") => (RuleGroup::Unspecified, Rule::RaiseVanillaClass), - (Tryceratops, "003") => (RuleGroup::Unspecified, Rule::RaiseVanillaArgs), - (Tryceratops, "004") => (RuleGroup::Unspecified, Rule::TypeCheckWithoutTypeError), - (Tryceratops, "200") => (RuleGroup::Unspecified, Rule::ReraiseNoCause), - (Tryceratops, "201") => (RuleGroup::Unspecified, Rule::VerboseRaise), - (Tryceratops, "300") => (RuleGroup::Unspecified, Rule::TryConsiderElse), - (Tryceratops, "301") => (RuleGroup::Unspecified, Rule::RaiseWithinTry), - (Tryceratops, "302") => (RuleGroup::Unspecified, Rule::UselessTryExcept), - (Tryceratops, "400") => (RuleGroup::Unspecified, Rule::ErrorInsteadOfException), - (Tryceratops, "401") => (RuleGroup::Unspecified, Rule::VerboseLogMessage), + (Tryceratops, "002") => (RuleGroup::Unspecified, rules::tryceratops::rules::RaiseVanillaClass), + (Tryceratops, "003") => (RuleGroup::Unspecified, rules::tryceratops::rules::RaiseVanillaArgs), + (Tryceratops, "004") => (RuleGroup::Unspecified, rules::tryceratops::rules::TypeCheckWithoutTypeError), + (Tryceratops, "200") => (RuleGroup::Unspecified, rules::tryceratops::rules::ReraiseNoCause), + (Tryceratops, "201") => (RuleGroup::Unspecified, rules::tryceratops::rules::VerboseRaise), + (Tryceratops, "300") => (RuleGroup::Unspecified, rules::tryceratops::rules::TryConsiderElse), + (Tryceratops, "301") => (RuleGroup::Unspecified, rules::tryceratops::rules::RaiseWithinTry), + (Tryceratops, "302") => (RuleGroup::Unspecified, rules::tryceratops::rules::UselessTryExcept), + (Tryceratops, "400") => (RuleGroup::Unspecified, rules::tryceratops::rules::ErrorInsteadOfException), + (Tryceratops, "401") => (RuleGroup::Unspecified, rules::tryceratops::rules::VerboseLogMessage), // flake8-use-pathlib - (Flake8UsePathlib, "100") => (RuleGroup::Unspecified, Rule::OsPathAbspath), - (Flake8UsePathlib, "101") => (RuleGroup::Unspecified, Rule::OsChmod), - (Flake8UsePathlib, "102") => (RuleGroup::Unspecified, Rule::OsMkdir), - (Flake8UsePathlib, "103") => (RuleGroup::Unspecified, Rule::OsMakedirs), - (Flake8UsePathlib, "104") => (RuleGroup::Unspecified, Rule::OsRename), - (Flake8UsePathlib, "105") => (RuleGroup::Unspecified, Rule::PathlibReplace), - (Flake8UsePathlib, "106") => (RuleGroup::Unspecified, Rule::OsRmdir), - (Flake8UsePathlib, "107") => (RuleGroup::Unspecified, Rule::OsRemove), - (Flake8UsePathlib, "108") => (RuleGroup::Unspecified, Rule::OsUnlink), - (Flake8UsePathlib, "109") => (RuleGroup::Unspecified, Rule::OsGetcwd), - (Flake8UsePathlib, "110") => (RuleGroup::Unspecified, Rule::OsPathExists), - (Flake8UsePathlib, "111") => (RuleGroup::Unspecified, Rule::OsPathExpanduser), - (Flake8UsePathlib, "112") => (RuleGroup::Unspecified, Rule::OsPathIsdir), - (Flake8UsePathlib, "113") => (RuleGroup::Unspecified, Rule::OsPathIsfile), - (Flake8UsePathlib, "114") => (RuleGroup::Unspecified, Rule::OsPathIslink), - (Flake8UsePathlib, "115") => (RuleGroup::Unspecified, Rule::OsReadlink), - (Flake8UsePathlib, "116") => (RuleGroup::Unspecified, Rule::OsStat), - (Flake8UsePathlib, "117") => (RuleGroup::Unspecified, Rule::OsPathIsabs), - (Flake8UsePathlib, "118") => (RuleGroup::Unspecified, Rule::OsPathJoin), - (Flake8UsePathlib, "119") => (RuleGroup::Unspecified, Rule::OsPathBasename), - (Flake8UsePathlib, "120") => (RuleGroup::Unspecified, Rule::OsPathDirname), - (Flake8UsePathlib, "121") => (RuleGroup::Unspecified, Rule::OsPathSamefile), - (Flake8UsePathlib, "122") => (RuleGroup::Unspecified, Rule::OsPathSplitext), - (Flake8UsePathlib, "123") => (RuleGroup::Unspecified, Rule::BuiltinOpen), - (Flake8UsePathlib, "124") => (RuleGroup::Unspecified, Rule::PyPath), + (Flake8UsePathlib, "100") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathAbspath), + (Flake8UsePathlib, "101") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsChmod), + (Flake8UsePathlib, "102") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsMkdir), + (Flake8UsePathlib, "103") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsMakedirs), + (Flake8UsePathlib, "104") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsRename), + (Flake8UsePathlib, "105") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::PathlibReplace), + (Flake8UsePathlib, "106") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsRmdir), + (Flake8UsePathlib, "107") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsRemove), + (Flake8UsePathlib, "108") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsUnlink), + (Flake8UsePathlib, "109") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsGetcwd), + (Flake8UsePathlib, "110") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathExists), + (Flake8UsePathlib, "111") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathExpanduser), + (Flake8UsePathlib, "112") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathIsdir), + (Flake8UsePathlib, "113") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathIsfile), + (Flake8UsePathlib, "114") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathIslink), + (Flake8UsePathlib, "115") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsReadlink), + (Flake8UsePathlib, "116") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsStat), + (Flake8UsePathlib, "117") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathIsabs), + (Flake8UsePathlib, "118") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathJoin), + (Flake8UsePathlib, "119") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathBasename), + (Flake8UsePathlib, "120") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathDirname), + (Flake8UsePathlib, "121") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathSamefile), + (Flake8UsePathlib, "122") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::OsPathSplitext), + (Flake8UsePathlib, "123") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::BuiltinOpen), + (Flake8UsePathlib, "124") => (RuleGroup::Unspecified, rules::flake8_use_pathlib::violations::PyPath), // flake8-logging-format - (Flake8LoggingFormat, "001") => (RuleGroup::Unspecified, Rule::LoggingStringFormat), - (Flake8LoggingFormat, "002") => (RuleGroup::Unspecified, Rule::LoggingPercentFormat), - (Flake8LoggingFormat, "003") => (RuleGroup::Unspecified, Rule::LoggingStringConcat), - (Flake8LoggingFormat, "004") => (RuleGroup::Unspecified, Rule::LoggingFString), - (Flake8LoggingFormat, "010") => (RuleGroup::Unspecified, Rule::LoggingWarn), - (Flake8LoggingFormat, "101") => (RuleGroup::Unspecified, Rule::LoggingExtraAttrClash), - (Flake8LoggingFormat, "201") => (RuleGroup::Unspecified, Rule::LoggingExcInfo), - (Flake8LoggingFormat, "202") => (RuleGroup::Unspecified, Rule::LoggingRedundantExcInfo), + (Flake8LoggingFormat, "001") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingStringFormat), + (Flake8LoggingFormat, "002") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingPercentFormat), + (Flake8LoggingFormat, "003") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingStringConcat), + (Flake8LoggingFormat, "004") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingFString), + (Flake8LoggingFormat, "010") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingWarn), + (Flake8LoggingFormat, "101") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingExtraAttrClash), + (Flake8LoggingFormat, "201") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingExcInfo), + (Flake8LoggingFormat, "202") => (RuleGroup::Unspecified, rules::flake8_logging_format::violations::LoggingRedundantExcInfo), // flake8-raise - (Flake8Raise, "102") => (RuleGroup::Unspecified, Rule::UnnecessaryParenOnRaiseException), + (Flake8Raise, "102") => (RuleGroup::Unspecified, rules::flake8_raise::rules::UnnecessaryParenOnRaiseException), // flake8-self - (Flake8Self, "001") => (RuleGroup::Unspecified, Rule::PrivateMemberAccess), + (Flake8Self, "001") => (RuleGroup::Unspecified, rules::flake8_self::rules::PrivateMemberAccess), // numpy - (Numpy, "001") => (RuleGroup::Unspecified, Rule::NumpyDeprecatedTypeAlias), - (Numpy, "002") => (RuleGroup::Unspecified, Rule::NumpyLegacyRandom), + (Numpy, "001") => (RuleGroup::Unspecified, rules::numpy::rules::NumpyDeprecatedTypeAlias), + (Numpy, "002") => (RuleGroup::Unspecified, rules::numpy::rules::NumpyLegacyRandom), // ruff - (Ruff, "001") => (RuleGroup::Unspecified, Rule::AmbiguousUnicodeCharacterString), - (Ruff, "002") => (RuleGroup::Unspecified, Rule::AmbiguousUnicodeCharacterDocstring), - (Ruff, "003") => (RuleGroup::Unspecified, Rule::AmbiguousUnicodeCharacterComment), - (Ruff, "005") => (RuleGroup::Unspecified, Rule::CollectionLiteralConcatenation), - (Ruff, "006") => (RuleGroup::Unspecified, Rule::AsyncioDanglingTask), - (Ruff, "007") => (RuleGroup::Unspecified, Rule::PairwiseOverZipped), - (Ruff, "008") => (RuleGroup::Unspecified, Rule::MutableDataclassDefault), - (Ruff, "009") => (RuleGroup::Unspecified, Rule::FunctionCallInDataclassDefaultArgument), - (Ruff, "010") => (RuleGroup::Unspecified, Rule::ExplicitFStringTypeConversion), - (Ruff, "100") => (RuleGroup::Unspecified, Rule::UnusedNOQA), - (Ruff, "200") => (RuleGroup::Unspecified, Rule::InvalidPyprojectToml), + (Ruff, "001") => (RuleGroup::Unspecified, rules::ruff::rules::AmbiguousUnicodeCharacterString), + (Ruff, "002") => (RuleGroup::Unspecified, rules::ruff::rules::AmbiguousUnicodeCharacterDocstring), + (Ruff, "003") => (RuleGroup::Unspecified, rules::ruff::rules::AmbiguousUnicodeCharacterComment), + (Ruff, "005") => (RuleGroup::Unspecified, rules::ruff::rules::CollectionLiteralConcatenation), + (Ruff, "006") => (RuleGroup::Unspecified, rules::ruff::rules::AsyncioDanglingTask), + (Ruff, "007") => (RuleGroup::Unspecified, rules::ruff::rules::PairwiseOverZipped), + (Ruff, "008") => (RuleGroup::Unspecified, rules::ruff::rules::MutableDataclassDefault), + (Ruff, "009") => (RuleGroup::Unspecified, rules::ruff::rules::FunctionCallInDataclassDefaultArgument), + (Ruff, "010") => (RuleGroup::Unspecified, rules::ruff::rules::ExplicitFStringTypeConversion), + (Ruff, "100") => (RuleGroup::Unspecified, rules::ruff::rules::UnusedNOQA), + (Ruff, "200") => (RuleGroup::Unspecified, rules::ruff::rules::InvalidPyprojectToml), // flake8-django - (Flake8Django, "001") => (RuleGroup::Unspecified, Rule::DjangoNullableModelStringField), - (Flake8Django, "003") => (RuleGroup::Unspecified, Rule::DjangoLocalsInRenderFunction), - (Flake8Django, "006") => (RuleGroup::Unspecified, Rule::DjangoExcludeWithModelForm), - (Flake8Django, "007") => (RuleGroup::Unspecified, Rule::DjangoAllWithModelForm), - (Flake8Django, "008") => (RuleGroup::Unspecified, Rule::DjangoModelWithoutDunderStr), - (Flake8Django, "012") => (RuleGroup::Unspecified, Rule::DjangoUnorderedBodyContentInModel), - (Flake8Django, "013") => (RuleGroup::Unspecified, Rule::DjangoNonLeadingReceiverDecorator), + (Flake8Django, "001") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoNullableModelStringField), + (Flake8Django, "003") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoLocalsInRenderFunction), + (Flake8Django, "006") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoExcludeWithModelForm), + (Flake8Django, "007") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoAllWithModelForm), + (Flake8Django, "008") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoModelWithoutDunderStr), + (Flake8Django, "012") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoUnorderedBodyContentInModel), + (Flake8Django, "013") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoNonLeadingReceiverDecorator), // flynt - // Reserved: (Flynt, "001") => (RuleGroup::Unspecified, Rule::StringConcatenationToFString), - (Flynt, "002") => (RuleGroup::Unspecified, Rule::StaticJoinToFString), + // Reserved: (Flynt, "001") => (RuleGroup::Unspecified, Rule: :StringConcatenationToFString), + (Flynt, "002") => (RuleGroup::Unspecified, rules::flynt::rules::StaticJoinToFString), // flake8-todos - (Flake8Todos, "001") => (RuleGroup::Unspecified, Rule::InvalidTodoTag), - (Flake8Todos, "002") => (RuleGroup::Unspecified, Rule::MissingTodoAuthor), - (Flake8Todos, "003") => (RuleGroup::Unspecified, Rule::MissingTodoLink), - (Flake8Todos, "004") => (RuleGroup::Unspecified, Rule::MissingTodoColon), - (Flake8Todos, "005") => (RuleGroup::Unspecified, Rule::MissingTodoDescription), - (Flake8Todos, "006") => (RuleGroup::Unspecified, Rule::InvalidTodoCapitalization), - (Flake8Todos, "007") => (RuleGroup::Unspecified, Rule::MissingSpaceAfterTodoColon), + (Flake8Todos, "001") => (RuleGroup::Unspecified, rules::flake8_todos::rules::InvalidTodoTag), + (Flake8Todos, "002") => (RuleGroup::Unspecified, rules::flake8_todos::rules::MissingTodoAuthor), + (Flake8Todos, "003") => (RuleGroup::Unspecified, rules::flake8_todos::rules::MissingTodoLink), + (Flake8Todos, "004") => (RuleGroup::Unspecified, rules::flake8_todos::rules::MissingTodoColon), + (Flake8Todos, "005") => (RuleGroup::Unspecified, rules::flake8_todos::rules::MissingTodoDescription), + (Flake8Todos, "006") => (RuleGroup::Unspecified, rules::flake8_todos::rules::InvalidTodoCapitalization), + (Flake8Todos, "007") => (RuleGroup::Unspecified, rules::flake8_todos::rules::MissingSpaceAfterTodoColon), // airflow - (Airflow, "001") => (RuleGroup::Unspecified, Rule::AirflowVariableNameTaskIdMismatch), + (Airflow, "001") => (RuleGroup::Unspecified, rules::airflow::rules::AirflowVariableNameTaskIdMismatch), // flake8-fixme - (Flake8Fixme, "001") => (RuleGroup::Unspecified, Rule::LineContainsFixme), - (Flake8Fixme, "002") => (RuleGroup::Unspecified, Rule::LineContainsTodo), - (Flake8Fixme, "003") => (RuleGroup::Unspecified, Rule::LineContainsXxx), - (Flake8Fixme, "004") => (RuleGroup::Unspecified, Rule::LineContainsHack), + (Flake8Fixme, "001") => (RuleGroup::Unspecified, rules::flake8_fixme::rules::LineContainsFixme), + (Flake8Fixme, "002") => (RuleGroup::Unspecified, rules::flake8_fixme::rules::LineContainsTodo), + (Flake8Fixme, "003") => (RuleGroup::Unspecified, rules::flake8_fixme::rules::LineContainsXxx), + (Flake8Fixme, "004") => (RuleGroup::Unspecified, rules::flake8_fixme::rules::LineContainsHack), _ => return None, }) diff --git a/crates/ruff/src/registry.rs b/crates/ruff/src/registry.rs index 29bd69398f..8d2b1baa1e 100644 --- a/crates/ruff/src/registry.rs +++ b/crates/ruff/src/registry.rs @@ -1,690 +1,16 @@ -//! Registry of all [`Rule`] implementations. +//! Remnant of the registry of all [`Rule`] implementations, now it's reexporting from codes.rs +//! with some helper symbols -use strum_macros::{AsRefStr, EnumIter}; +use strum_macros::EnumIter; -use ruff_diagnostics::Violation; +pub use codes::Rule; use ruff_macros::RuleNamespace; pub use rule_set::{RuleSet, RuleSetIterator}; use crate::codes::{self, RuleCodePrefix}; -use crate::rules; mod rule_set; -ruff_macros::register_rules!( - // pycodestyle errors - rules::pycodestyle::rules::MixedSpacesAndTabs, - rules::pycodestyle::rules::logical_lines::IndentationWithInvalidMultiple, - rules::pycodestyle::rules::logical_lines::NoIndentedBlock, - rules::pycodestyle::rules::logical_lines::UnexpectedIndentation, - rules::pycodestyle::rules::logical_lines::IndentationWithInvalidMultipleComment, - rules::pycodestyle::rules::logical_lines::NoIndentedBlockComment, - rules::pycodestyle::rules::logical_lines::UnexpectedIndentationComment, - rules::pycodestyle::rules::logical_lines::OverIndented, - rules::pycodestyle::rules::logical_lines::WhitespaceAfterOpenBracket, - rules::pycodestyle::rules::logical_lines::WhitespaceBeforeCloseBracket, - rules::pycodestyle::rules::logical_lines::WhitespaceBeforePunctuation, - rules::pycodestyle::rules::logical_lines::MultipleSpacesBeforeOperator, - rules::pycodestyle::rules::logical_lines::MultipleSpacesAfterOperator, - rules::pycodestyle::rules::logical_lines::TabBeforeOperator, - rules::pycodestyle::rules::logical_lines::TabAfterOperator, - rules::pycodestyle::rules::logical_lines::TooFewSpacesBeforeInlineComment, - rules::pycodestyle::rules::logical_lines::NoSpaceAfterInlineComment, - rules::pycodestyle::rules::logical_lines::NoSpaceAfterBlockComment, - rules::pycodestyle::rules::logical_lines::MultipleLeadingHashesForBlockComment, - rules::pycodestyle::rules::logical_lines::MultipleSpacesAfterKeyword, - rules::pycodestyle::rules::logical_lines::MissingWhitespace, - rules::pycodestyle::rules::logical_lines::MissingWhitespaceAfterKeyword, - rules::pycodestyle::rules::logical_lines::MultipleSpacesBeforeKeyword, - rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundOperator, - rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundArithmeticOperator, - rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundBitwiseOrShiftOperator, - rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundModuloOperator, - rules::pycodestyle::rules::logical_lines::TabAfterKeyword, - rules::pycodestyle::rules::logical_lines::UnexpectedSpacesAroundKeywordParameterEquals, - rules::pycodestyle::rules::logical_lines::MissingWhitespaceAroundParameterEquals, - rules::pycodestyle::rules::logical_lines::WhitespaceBeforeParameters, - rules::pycodestyle::rules::logical_lines::TabBeforeKeyword, - rules::pycodestyle::rules::MultipleImportsOnOneLine, - rules::pycodestyle::rules::ModuleImportNotAtTopOfFile, - rules::pycodestyle::rules::LineTooLong, - rules::pycodestyle::rules::MultipleStatementsOnOneLineColon, - rules::pycodestyle::rules::MultipleStatementsOnOneLineSemicolon, - rules::pycodestyle::rules::UselessSemicolon, - rules::pycodestyle::rules::NoneComparison, - rules::pycodestyle::rules::TrueFalseComparison, - rules::pycodestyle::rules::NotInTest, - rules::pycodestyle::rules::NotIsTest, - rules::pycodestyle::rules::TypeComparison, - rules::pycodestyle::rules::BareExcept, - rules::pycodestyle::rules::LambdaAssignment, - rules::pycodestyle::rules::AmbiguousVariableName, - rules::pycodestyle::rules::AmbiguousClassName, - rules::pycodestyle::rules::AmbiguousFunctionName, - rules::pycodestyle::rules::IOError, - rules::pycodestyle::rules::SyntaxError, - // pycodestyle warnings - rules::pycodestyle::rules::TabIndentation, - rules::pycodestyle::rules::TrailingWhitespace, - rules::pycodestyle::rules::MissingNewlineAtEndOfFile, - rules::pycodestyle::rules::BlankLineWithWhitespace, - rules::pycodestyle::rules::DocLineTooLong, - rules::pycodestyle::rules::InvalidEscapeSequence, - // pyflakes - rules::pyflakes::rules::UnusedImport, - rules::pyflakes::rules::ImportShadowedByLoopVar, - rules::pyflakes::rules::UndefinedLocalWithImportStar, - rules::pyflakes::rules::LateFutureImport, - rules::pyflakes::rules::UndefinedLocalWithImportStarUsage, - rules::pyflakes::rules::UndefinedLocalWithNestedImportStarUsage, - rules::pyflakes::rules::FutureFeatureNotDefined, - rules::pyflakes::rules::PercentFormatInvalidFormat, - rules::pyflakes::rules::PercentFormatExpectedMapping, - rules::pyflakes::rules::PercentFormatExpectedSequence, - rules::pyflakes::rules::PercentFormatExtraNamedArguments, - rules::pyflakes::rules::PercentFormatMissingArgument, - rules::pyflakes::rules::PercentFormatMixedPositionalAndNamed, - rules::pyflakes::rules::PercentFormatPositionalCountMismatch, - rules::pyflakes::rules::PercentFormatStarRequiresSequence, - rules::pyflakes::rules::PercentFormatUnsupportedFormatCharacter, - rules::pyflakes::rules::StringDotFormatInvalidFormat, - rules::pyflakes::rules::StringDotFormatExtraNamedArguments, - rules::pyflakes::rules::StringDotFormatExtraPositionalArguments, - rules::pyflakes::rules::StringDotFormatMissingArguments, - rules::pyflakes::rules::StringDotFormatMixingAutomatic, - rules::pyflakes::rules::FStringMissingPlaceholders, - rules::pyflakes::rules::MultiValueRepeatedKeyLiteral, - rules::pyflakes::rules::MultiValueRepeatedKeyVariable, - rules::pyflakes::rules::ExpressionsInStarAssignment, - rules::pyflakes::rules::MultipleStarredExpressions, - rules::pyflakes::rules::AssertTuple, - rules::pyflakes::rules::IsLiteral, - rules::pyflakes::rules::InvalidPrintSyntax, - rules::pyflakes::rules::IfTuple, - rules::pyflakes::rules::BreakOutsideLoop, - rules::pyflakes::rules::ContinueOutsideLoop, - rules::pyflakes::rules::YieldOutsideFunction, - rules::pyflakes::rules::ReturnOutsideFunction, - rules::pyflakes::rules::DefaultExceptNotLast, - rules::pyflakes::rules::ForwardAnnotationSyntaxError, - rules::pyflakes::rules::RedefinedWhileUnused, - rules::pyflakes::rules::UndefinedName, - rules::pyflakes::rules::UndefinedExport, - rules::pyflakes::rules::UndefinedLocal, - rules::pyflakes::rules::UnusedVariable, - rules::pyflakes::rules::UnusedAnnotation, - rules::pyflakes::rules::RaiseNotImplemented, - // pylint - rules::pylint::rules::AssertOnStringLiteral, - rules::pylint::rules::UselessReturn, - rules::pylint::rules::YieldFromInAsyncFunction, - rules::pylint::rules::YieldInInit, - rules::pylint::rules::InvalidAllObject, - rules::pylint::rules::InvalidAllFormat, - rules::pylint::rules::InvalidEnvvarDefault, - rules::pylint::rules::InvalidEnvvarValue, - rules::pylint::rules::BadStringFormatType, - rules::pylint::rules::BidirectionalUnicode, - rules::pylint::rules::BinaryOpException, - rules::pylint::rules::ImportSelf, - rules::pylint::rules::InvalidCharacterBackspace, - rules::pylint::rules::InvalidCharacterSub, - rules::pylint::rules::InvalidCharacterEsc, - rules::pylint::rules::InvalidCharacterNul, - rules::pylint::rules::InvalidCharacterZeroWidthSpace, - rules::pylint::rules::BadStrStripCall, - rules::pylint::rules::CollapsibleElseIf, - rules::pylint::rules::ContinueInFinally, - rules::pylint::rules::UselessImportAlias, - rules::pylint::rules::UnnecessaryDirectLambdaCall, - rules::pylint::rules::NonlocalWithoutBinding, - rules::pylint::rules::LoadBeforeGlobalDeclaration, - rules::pylint::rules::AwaitOutsideAsync, - rules::pylint::rules::PropertyWithParameters, - rules::pylint::rules::ReturnInInit, - rules::pylint::rules::ManualFromImport, - rules::pylint::rules::CompareToEmptyString, - rules::pylint::rules::ComparisonOfConstant, - rules::pylint::rules::RepeatedIsinstanceCalls, - rules::pylint::rules::SysExitAlias, - rules::pylint::rules::MagicValueComparison, - rules::pylint::rules::UselessElseOnLoop, - rules::pylint::rules::GlobalStatement, - rules::pylint::rules::GlobalVariableNotAssigned, - rules::pylint::rules::TooManyReturnStatements, - rules::pylint::rules::TooManyArguments, - rules::pylint::rules::TooManyBranches, - rules::pylint::rules::TooManyStatements, - rules::pylint::rules::RedefinedLoopName, - rules::pylint::rules::LoggingTooFewArgs, - rules::pylint::rules::LoggingTooManyArgs, - rules::pylint::rules::UnexpectedSpecialMethodSignature, - rules::pylint::rules::NestedMinMax, - rules::pylint::rules::DuplicateValue, - rules::pylint::rules::DuplicateBases, - rules::pylint::rules::NamedExprWithoutContext, - rules::pylint::rules::IterationOverSet, - // flake8-async - rules::flake8_async::rules::BlockingHttpCallInAsyncFunction, - rules::flake8_async::rules::OpenSleepOrSubprocessInAsyncFunction, - rules::flake8_async::rules::BlockingOsCallInAsyncFunction, - // flake8-builtins - rules::flake8_builtins::rules::BuiltinVariableShadowing, - rules::flake8_builtins::rules::BuiltinArgumentShadowing, - rules::flake8_builtins::rules::BuiltinAttributeShadowing, - // flake8-bugbear - rules::flake8_bugbear::rules::UnaryPrefixIncrement, - rules::flake8_bugbear::rules::AssignmentToOsEnviron, - rules::flake8_bugbear::rules::UnreliableCallableCheck, - rules::flake8_bugbear::rules::StripWithMultiCharacters, - rules::flake8_bugbear::rules::MutableArgumentDefault, - rules::flake8_bugbear::rules::NoExplicitStacklevel, - rules::flake8_bugbear::rules::UnusedLoopControlVariable, - rules::flake8_bugbear::rules::FunctionCallInDefaultArgument, - rules::flake8_bugbear::rules::GetAttrWithConstant, - rules::flake8_bugbear::rules::SetAttrWithConstant, - rules::flake8_bugbear::rules::AssertFalse, - rules::flake8_bugbear::rules::JumpStatementInFinally, - rules::flake8_bugbear::rules::RedundantTupleInExceptionHandler, - rules::flake8_bugbear::rules::DuplicateHandlerException, - rules::flake8_bugbear::rules::UselessComparison, - rules::flake8_bugbear::rules::CannotRaiseLiteral, - rules::flake8_bugbear::rules::AssertRaisesException, - rules::flake8_bugbear::rules::UselessExpression, - rules::flake8_bugbear::rules::CachedInstanceMethod, - rules::flake8_bugbear::rules::LoopVariableOverridesIterator, - rules::flake8_bugbear::rules::FStringDocstring, - rules::flake8_bugbear::rules::UselessContextlibSuppress, - rules::flake8_bugbear::rules::FunctionUsesLoopVariable, - rules::flake8_bugbear::rules::AbstractBaseClassWithoutAbstractMethod, - rules::flake8_bugbear::rules::DuplicateTryBlockException, - rules::flake8_bugbear::rules::StarArgUnpackingAfterKeywordArg, - rules::flake8_bugbear::rules::EmptyMethodWithoutAbstractDecorator, - rules::flake8_bugbear::rules::RaiseWithoutFromInsideExcept, - rules::flake8_bugbear::rules::ZipWithoutExplicitStrict, - rules::flake8_bugbear::rules::ExceptWithEmptyTuple, - rules::flake8_bugbear::rules::ExceptWithNonExceptionClasses, - rules::flake8_bugbear::rules::ReuseOfGroupbyGenerator, - rules::flake8_bugbear::rules::UnintentionalTypeAnnotation, - // flake8-blind-except - rules::flake8_blind_except::rules::BlindExcept, - // flake8-comprehensions - rules::flake8_comprehensions::rules::UnnecessaryCallAroundSorted, - rules::flake8_comprehensions::rules::UnnecessaryCollectionCall, - rules::flake8_comprehensions::rules::UnnecessaryComprehension, - rules::flake8_comprehensions::rules::UnnecessaryComprehensionAnyAll, - rules::flake8_comprehensions::rules::UnnecessaryDoubleCastOrProcess, - rules::flake8_comprehensions::rules::UnnecessaryGeneratorDict, - rules::flake8_comprehensions::rules::UnnecessaryGeneratorList, - rules::flake8_comprehensions::rules::UnnecessaryGeneratorSet, - rules::flake8_comprehensions::rules::UnnecessaryListCall, - rules::flake8_comprehensions::rules::UnnecessaryListComprehensionDict, - rules::flake8_comprehensions::rules::UnnecessaryListComprehensionSet, - rules::flake8_comprehensions::rules::UnnecessaryLiteralDict, - rules::flake8_comprehensions::rules::UnnecessaryLiteralSet, - rules::flake8_comprehensions::rules::UnnecessaryLiteralWithinDictCall, - rules::flake8_comprehensions::rules::UnnecessaryLiteralWithinListCall, - rules::flake8_comprehensions::rules::UnnecessaryLiteralWithinTupleCall, - rules::flake8_comprehensions::rules::UnnecessaryMap, - rules::flake8_comprehensions::rules::UnnecessarySubscriptReversal, - // flake8-debugger - rules::flake8_debugger::rules::Debugger, - // mccabe - rules::mccabe::rules::ComplexStructure, - // flake8-tidy-imports - rules::flake8_tidy_imports::rules::BannedApi, - rules::flake8_tidy_imports::rules::RelativeImports, - // flake8-return - rules::flake8_return::rules::UnnecessaryReturnNone, - rules::flake8_return::rules::ImplicitReturnValue, - rules::flake8_return::rules::ImplicitReturn, - rules::flake8_return::rules::UnnecessaryAssign, - rules::flake8_return::rules::SuperfluousElseReturn, - rules::flake8_return::rules::SuperfluousElseRaise, - rules::flake8_return::rules::SuperfluousElseContinue, - rules::flake8_return::rules::SuperfluousElseBreak, - // flake8-implicit-str-concat - rules::flake8_implicit_str_concat::rules::SingleLineImplicitStringConcatenation, - rules::flake8_implicit_str_concat::rules::MultiLineImplicitStringConcatenation, - rules::flake8_implicit_str_concat::rules::ExplicitStringConcatenation, - // flake8-print - rules::flake8_print::rules::Print, - rules::flake8_print::rules::PPrint, - // flake8-quotes - rules::flake8_quotes::rules::BadQuotesInlineString, - rules::flake8_quotes::rules::BadQuotesMultilineString, - rules::flake8_quotes::rules::BadQuotesDocstring, - rules::flake8_quotes::rules::AvoidableEscapedQuote, - // flake8-annotations - rules::flake8_annotations::rules::MissingTypeFunctionArgument, - rules::flake8_annotations::rules::MissingTypeArgs, - rules::flake8_annotations::rules::MissingTypeKwargs, - rules::flake8_annotations::rules::MissingTypeSelf, - rules::flake8_annotations::rules::MissingTypeCls, - rules::flake8_annotations::rules::MissingReturnTypeUndocumentedPublicFunction, - rules::flake8_annotations::rules::MissingReturnTypePrivateFunction, - rules::flake8_annotations::rules::MissingReturnTypeSpecialMethod, - rules::flake8_annotations::rules::MissingReturnTypeStaticMethod, - rules::flake8_annotations::rules::MissingReturnTypeClassMethod, - rules::flake8_annotations::rules::AnyType, - // flake8-future-annotations - rules::flake8_future_annotations::rules::FutureRewritableTypeAnnotation, - rules::flake8_future_annotations::rules::FutureRequiredTypeAnnotation, - // flake8-2020 - rules::flake8_2020::rules::SysVersionSlice3, - rules::flake8_2020::rules::SysVersion2, - rules::flake8_2020::rules::SysVersionCmpStr3, - rules::flake8_2020::rules::SysVersionInfo0Eq3, - rules::flake8_2020::rules::SixPY3, - rules::flake8_2020::rules::SysVersionInfo1CmpInt, - rules::flake8_2020::rules::SysVersionInfoMinorCmpInt, - rules::flake8_2020::rules::SysVersion0, - rules::flake8_2020::rules::SysVersionCmpStr10, - rules::flake8_2020::rules::SysVersionSlice1, - // flake8-simplify - rules::flake8_simplify::rules::IfElseBlockInsteadOfDictLookup, - rules::flake8_simplify::rules::DuplicateIsinstanceCall, - rules::flake8_simplify::rules::CollapsibleIf, - rules::flake8_simplify::rules::NeedlessBool, - rules::flake8_simplify::rules::SuppressibleException, - rules::flake8_simplify::rules::ReturnInTryExceptFinally, - rules::flake8_simplify::rules::IfElseBlockInsteadOfIfExp, - rules::flake8_simplify::rules::CompareWithTuple, - rules::flake8_simplify::rules::ReimplementedBuiltin, - rules::flake8_simplify::rules::UncapitalizedEnvironmentVariables, - rules::flake8_simplify::rules::IfWithSameArms, - rules::flake8_simplify::rules::OpenFileWithContextHandler, - rules::flake8_simplify::rules::MultipleWithStatements, - rules::flake8_simplify::rules::InDictKeys, - rules::flake8_simplify::rules::NegateEqualOp, - rules::flake8_simplify::rules::NegateNotEqualOp, - rules::flake8_simplify::rules::DoubleNegation, - rules::flake8_simplify::rules::IfExprWithTrueFalse, - rules::flake8_simplify::rules::IfExprWithFalseTrue, - rules::flake8_simplify::rules::IfExprWithTwistedArms, - rules::flake8_simplify::rules::ExprAndNotExpr, - rules::flake8_simplify::rules::ExprOrNotExpr, - rules::flake8_simplify::rules::ExprOrTrue, - rules::flake8_simplify::rules::ExprAndFalse, - rules::flake8_simplify::rules::YodaConditions, - rules::flake8_simplify::rules::IfElseBlockInsteadOfDictGet, - rules::flake8_simplify::rules::DictGetWithNoneDefault, - // pyupgrade - rules::pyupgrade::rules::UselessMetaclassType, - rules::pyupgrade::rules::TypeOfPrimitive, - rules::pyupgrade::rules::UselessObjectInheritance, - rules::pyupgrade::rules::DeprecatedUnittestAlias, - rules::pyupgrade::rules::NonPEP585Annotation, - rules::pyupgrade::rules::NonPEP604Annotation, - rules::pyupgrade::rules::SuperCallWithParameters, - rules::pyupgrade::rules::UTF8EncodingDeclaration, - rules::pyupgrade::rules::UnnecessaryFutureImport, - rules::pyupgrade::rules::LRUCacheWithoutParameters, - rules::pyupgrade::rules::UnnecessaryEncodeUTF8, - rules::pyupgrade::rules::ConvertTypedDictFunctionalToClass, - rules::pyupgrade::rules::ConvertNamedTupleFunctionalToClass, - rules::pyupgrade::rules::RedundantOpenModes, - rules::pyupgrade::rules::DatetimeTimezoneUTC, - rules::pyupgrade::rules::NativeLiterals, - rules::pyupgrade::rules::TypingTextStrAlias, - rules::pyupgrade::rules::OpenAlias, - rules::pyupgrade::rules::ReplaceUniversalNewlines, - rules::pyupgrade::rules::ReplaceStdoutStderr, - rules::pyupgrade::rules::DeprecatedCElementTree, - rules::pyupgrade::rules::OSErrorAlias, - rules::pyupgrade::rules::UnicodeKindPrefix, - rules::pyupgrade::rules::DeprecatedMockImport, - rules::pyupgrade::rules::UnpackedListComprehension, - rules::pyupgrade::rules::YieldInForLoop, - rules::pyupgrade::rules::UnnecessaryBuiltinImport, - rules::pyupgrade::rules::FormatLiterals, - rules::pyupgrade::rules::PrintfStringFormatting, - rules::pyupgrade::rules::FString, - rules::pyupgrade::rules::LRUCacheWithMaxsizeNone, - rules::pyupgrade::rules::ExtraneousParentheses, - rules::pyupgrade::rules::DeprecatedImport, - rules::pyupgrade::rules::OutdatedVersionBlock, - rules::pyupgrade::rules::QuotedAnnotation, - rules::pyupgrade::rules::NonPEP604Isinstance, - // pydocstyle - rules::pydocstyle::rules::UndocumentedPublicModule, - rules::pydocstyle::rules::UndocumentedPublicClass, - rules::pydocstyle::rules::UndocumentedPublicMethod, - rules::pydocstyle::rules::UndocumentedPublicFunction, - rules::pydocstyle::rules::UndocumentedPublicPackage, - rules::pydocstyle::rules::UndocumentedMagicMethod, - rules::pydocstyle::rules::UndocumentedPublicNestedClass, - rules::pydocstyle::rules::UndocumentedPublicInit, - rules::pydocstyle::rules::FitsOnOneLine, - rules::pydocstyle::rules::NoBlankLineBeforeFunction, - rules::pydocstyle::rules::NoBlankLineAfterFunction, - rules::pydocstyle::rules::OneBlankLineBeforeClass, - rules::pydocstyle::rules::OneBlankLineAfterClass, - rules::pydocstyle::rules::BlankLineAfterSummary, - rules::pydocstyle::rules::IndentWithSpaces, - rules::pydocstyle::rules::UnderIndentation, - rules::pydocstyle::rules::OverIndentation, - rules::pydocstyle::rules::NewLineAfterLastParagraph, - rules::pydocstyle::rules::SurroundingWhitespace, - rules::pydocstyle::rules::BlankLineBeforeClass, - rules::pydocstyle::rules::MultiLineSummaryFirstLine, - rules::pydocstyle::rules::MultiLineSummarySecondLine, - rules::pydocstyle::rules::SectionNotOverIndented, - rules::pydocstyle::rules::SectionUnderlineNotOverIndented, - rules::pydocstyle::rules::TripleSingleQuotes, - rules::pydocstyle::rules::EscapeSequenceInDocstring, - rules::pydocstyle::rules::EndsInPeriod, - rules::pydocstyle::rules::NonImperativeMood, - rules::pydocstyle::rules::NoSignature, - rules::pydocstyle::rules::FirstLineCapitalized, - rules::pydocstyle::rules::DocstringStartsWithThis, - rules::pydocstyle::rules::CapitalizeSectionName, - rules::pydocstyle::rules::NewLineAfterSectionName, - rules::pydocstyle::rules::DashedUnderlineAfterSection, - rules::pydocstyle::rules::SectionUnderlineAfterName, - rules::pydocstyle::rules::SectionUnderlineMatchesSectionLength, - rules::pydocstyle::rules::NoBlankLineAfterSection, - rules::pydocstyle::rules::NoBlankLineBeforeSection, - rules::pydocstyle::rules::BlankLinesBetweenHeaderAndContent, - rules::pydocstyle::rules::BlankLineAfterLastSection, - rules::pydocstyle::rules::EmptyDocstringSection, - rules::pydocstyle::rules::EndsInPunctuation, - rules::pydocstyle::rules::SectionNameEndsInColon, - rules::pydocstyle::rules::UndocumentedParam, - rules::pydocstyle::rules::OverloadWithDocstring, - rules::pydocstyle::rules::EmptyDocstring, - // pep8-naming - rules::pep8_naming::rules::InvalidClassName, - rules::pep8_naming::rules::InvalidFunctionName, - rules::pep8_naming::rules::InvalidArgumentName, - rules::pep8_naming::rules::InvalidFirstArgumentNameForClassMethod, - rules::pep8_naming::rules::InvalidFirstArgumentNameForMethod, - rules::pep8_naming::rules::NonLowercaseVariableInFunction, - rules::pep8_naming::rules::DunderFunctionName, - rules::pep8_naming::rules::ConstantImportedAsNonConstant, - rules::pep8_naming::rules::LowercaseImportedAsNonLowercase, - rules::pep8_naming::rules::CamelcaseImportedAsLowercase, - rules::pep8_naming::rules::CamelcaseImportedAsConstant, - rules::pep8_naming::rules::MixedCaseVariableInClassScope, - rules::pep8_naming::rules::MixedCaseVariableInGlobalScope, - rules::pep8_naming::rules::CamelcaseImportedAsAcronym, - rules::pep8_naming::rules::ErrorSuffixOnExceptionName, - rules::pep8_naming::rules::InvalidModuleName, - // isort - rules::isort::rules::UnsortedImports, - rules::isort::rules::MissingRequiredImport, - // eradicate - rules::eradicate::rules::CommentedOutCode, - // flake8-bandit - rules::flake8_bandit::rules::Assert, - rules::flake8_bandit::rules::BadFilePermissions, - rules::flake8_bandit::rules::ExecBuiltin, - rules::flake8_bandit::rules::HardcodedBindAllInterfaces, - rules::flake8_bandit::rules::HardcodedPasswordDefault, - rules::flake8_bandit::rules::HardcodedPasswordFuncArg, - rules::flake8_bandit::rules::HardcodedPasswordString, - rules::flake8_bandit::rules::HardcodedSQLExpression, - rules::flake8_bandit::rules::HardcodedTempFile, - rules::flake8_bandit::rules::HashlibInsecureHashFunction, - rules::flake8_bandit::rules::Jinja2AutoescapeFalse, - rules::flake8_bandit::rules::ParamikoCall, - rules::flake8_bandit::rules::LoggingConfigInsecureListen, - rules::flake8_bandit::rules::RequestWithNoCertValidation, - rules::flake8_bandit::rules::RequestWithoutTimeout, - rules::flake8_bandit::rules::SnmpInsecureVersion, - rules::flake8_bandit::rules::SnmpWeakCryptography, - rules::flake8_bandit::rules::SubprocessPopenWithShellEqualsTrue, - rules::flake8_bandit::rules::SubprocessWithoutShellEqualsTrue, - rules::flake8_bandit::rules::CallWithShellEqualsTrue, - rules::flake8_bandit::rules::StartProcessWithAShell, - rules::flake8_bandit::rules::StartProcessWithNoShell, - rules::flake8_bandit::rules::StartProcessWithPartialPath, - rules::flake8_bandit::rules::SuspiciousEvalUsage, - rules::flake8_bandit::rules::SuspiciousFTPLibUsage, - rules::flake8_bandit::rules::SuspiciousInsecureCipherUsage, - rules::flake8_bandit::rules::SuspiciousInsecureCipherModeUsage, - rules::flake8_bandit::rules::SuspiciousInsecureHashUsage, - rules::flake8_bandit::rules::SuspiciousMarkSafeUsage, - rules::flake8_bandit::rules::SuspiciousMarshalUsage, - rules::flake8_bandit::rules::SuspiciousMktempUsage, - rules::flake8_bandit::rules::SuspiciousNonCryptographicRandomUsage, - rules::flake8_bandit::rules::SuspiciousPickleUsage, - rules::flake8_bandit::rules::SuspiciousTelnetUsage, - rules::flake8_bandit::rules::SuspiciousURLOpenUsage, - rules::flake8_bandit::rules::SuspiciousUnverifiedContextUsage, - rules::flake8_bandit::rules::SuspiciousXMLCElementTreeUsage, - rules::flake8_bandit::rules::SuspiciousXMLETreeUsage, - rules::flake8_bandit::rules::SuspiciousXMLElementTreeUsage, - rules::flake8_bandit::rules::SuspiciousXMLExpatBuilderUsage, - rules::flake8_bandit::rules::SuspiciousXMLExpatReaderUsage, - rules::flake8_bandit::rules::SuspiciousXMLMiniDOMUsage, - rules::flake8_bandit::rules::SuspiciousXMLPullDOMUsage, - rules::flake8_bandit::rules::SuspiciousXMLSaxUsage, - rules::flake8_bandit::rules::TryExceptContinue, - rules::flake8_bandit::rules::TryExceptPass, - rules::flake8_bandit::rules::UnsafeYAMLLoad, - // flake8-boolean-trap - rules::flake8_boolean_trap::rules::BooleanPositionalArgInFunctionDefinition, - rules::flake8_boolean_trap::rules::BooleanDefaultValueInFunctionDefinition, - rules::flake8_boolean_trap::rules::BooleanPositionalValueInFunctionCall, - // flake8-unused-arguments - rules::flake8_unused_arguments::rules::UnusedFunctionArgument, - rules::flake8_unused_arguments::rules::UnusedMethodArgument, - rules::flake8_unused_arguments::rules::UnusedClassMethodArgument, - rules::flake8_unused_arguments::rules::UnusedStaticMethodArgument, - rules::flake8_unused_arguments::rules::UnusedLambdaArgument, - // flake8-import-conventions - rules::flake8_import_conventions::rules::UnconventionalImportAlias, - rules::flake8_import_conventions::rules::BannedImportAlias, - rules::flake8_import_conventions::rules::BannedImportFrom, - // flake8-datetimez - rules::flake8_datetimez::rules::CallDatetimeWithoutTzinfo, - rules::flake8_datetimez::rules::CallDatetimeToday, - rules::flake8_datetimez::rules::CallDatetimeUtcnow, - rules::flake8_datetimez::rules::CallDatetimeUtcfromtimestamp, - rules::flake8_datetimez::rules::CallDatetimeNowWithoutTzinfo, - rules::flake8_datetimez::rules::CallDatetimeFromtimestamp, - rules::flake8_datetimez::rules::CallDatetimeStrptimeWithoutZone, - rules::flake8_datetimez::rules::CallDateToday, - rules::flake8_datetimez::rules::CallDateFromtimestamp, - // pygrep-hooks - rules::pygrep_hooks::rules::BlanketNOQA, - rules::pygrep_hooks::rules::BlanketTypeIgnore, - rules::pygrep_hooks::rules::DeprecatedLogWarn, - rules::pygrep_hooks::rules::Eval, - rules::pygrep_hooks::rules::InvalidMockAccess, - // pandas-vet - rules::pandas_vet::rules::PandasUseOfInplaceArgument, - rules::pandas_vet::rules::PandasUseOfDotIsNull, - rules::pandas_vet::rules::PandasUseOfDotNotNull, - rules::pandas_vet::rules::PandasUseOfDotIx, - rules::pandas_vet::rules::PandasUseOfDotAt, - rules::pandas_vet::rules::PandasUseOfDotIat, - rules::pandas_vet::rules::PandasUseOfDotPivotOrUnstack, - rules::pandas_vet::rules::PandasUseOfDotValues, - rules::pandas_vet::rules::PandasUseOfDotReadTable, - rules::pandas_vet::rules::PandasUseOfDotStack, - rules::pandas_vet::rules::PandasUseOfPdMerge, - rules::pandas_vet::rules::PandasDfVariableName, - // flake8-errmsg - rules::flake8_errmsg::rules::RawStringInException, - rules::flake8_errmsg::rules::FStringInException, - rules::flake8_errmsg::rules::DotFormatInException, - // flake8-pyi - rules::flake8_pyi::rules::AnyEqNeAnnotation, - rules::flake8_pyi::rules::ArgumentDefaultInStub, - rules::flake8_pyi::rules::AssignmentDefaultInStub, - rules::flake8_pyi::rules::BadVersionInfoComparison, - rules::flake8_pyi::rules::DocstringInStub, - rules::flake8_pyi::rules::IterMethodReturnIterable, - rules::flake8_pyi::rules::DuplicateUnionMember, - rules::flake8_pyi::rules::EllipsisInNonEmptyClassBody, - rules::flake8_pyi::rules::NonSelfReturnType, - rules::flake8_pyi::rules::CollectionsNamedTuple, - rules::flake8_pyi::rules::StringOrBytesTooLong, - rules::flake8_pyi::rules::NonEmptyStubBody, - rules::flake8_pyi::rules::PassInClassBody, - rules::flake8_pyi::rules::PassStatementStubBody, - rules::flake8_pyi::rules::NumericLiteralTooLong, - rules::flake8_pyi::rules::QuotedAnnotationInStub, - rules::flake8_pyi::rules::SnakeCaseTypeAlias, - rules::flake8_pyi::rules::StubBodyMultipleStatements, - rules::flake8_pyi::rules::TSuffixedTypeAlias, - rules::flake8_pyi::rules::TypeCommentInStub, - rules::flake8_pyi::rules::TypedArgumentDefaultInStub, - rules::flake8_pyi::rules::UnaliasedCollectionsAbcSetImport, - rules::flake8_pyi::rules::UnannotatedAssignmentInStub, - rules::flake8_pyi::rules::UnprefixedTypeParam, - rules::flake8_pyi::rules::UnrecognizedPlatformCheck, - rules::flake8_pyi::rules::UnrecognizedPlatformName, - // flake8-pytest-style - rules::flake8_pytest_style::rules::PytestFixtureIncorrectParenthesesStyle, - rules::flake8_pytest_style::rules::PytestFixturePositionalArgs, - rules::flake8_pytest_style::rules::PytestExtraneousScopeFunction, - rules::flake8_pytest_style::rules::PytestMissingFixtureNameUnderscore, - rules::flake8_pytest_style::rules::PytestIncorrectFixtureNameUnderscore, - rules::flake8_pytest_style::rules::PytestParametrizeNamesWrongType, - rules::flake8_pytest_style::rules::PytestParametrizeValuesWrongType, - rules::flake8_pytest_style::rules::PytestPatchWithLambda, - rules::flake8_pytest_style::rules::PytestUnittestAssertion, - rules::flake8_pytest_style::rules::PytestRaisesWithoutException, - rules::flake8_pytest_style::rules::PytestRaisesTooBroad, - rules::flake8_pytest_style::rules::PytestRaisesWithMultipleStatements, - rules::flake8_pytest_style::rules::PytestIncorrectPytestImport, - rules::flake8_pytest_style::rules::PytestAssertAlwaysFalse, - rules::flake8_pytest_style::rules::PytestFailWithoutMessage, - rules::flake8_pytest_style::rules::PytestAssertInExcept, - rules::flake8_pytest_style::rules::PytestCompositeAssertion, - rules::flake8_pytest_style::rules::PytestFixtureParamWithoutValue, - rules::flake8_pytest_style::rules::PytestDeprecatedYieldFixture, - rules::flake8_pytest_style::rules::PytestFixtureFinalizerCallback, - rules::flake8_pytest_style::rules::PytestUselessYieldFixture, - rules::flake8_pytest_style::rules::PytestIncorrectMarkParenthesesStyle, - rules::flake8_pytest_style::rules::PytestUnnecessaryAsyncioMarkOnFixture, - rules::flake8_pytest_style::rules::PytestErroneousUseFixturesOnFixture, - rules::flake8_pytest_style::rules::PytestUseFixturesWithoutParameters, - // flake8-pie - rules::flake8_pie::rules::UnnecessaryPass, - rules::flake8_pie::rules::DuplicateClassFieldDefinition, - rules::flake8_pie::rules::NonUniqueEnums, - rules::flake8_pie::rules::UnnecessarySpread, - rules::flake8_pie::rules::UnnecessaryDictKwargs, - rules::flake8_pie::rules::ReimplementedListBuiltin, - rules::flake8_pie::rules::MultipleStartsEndsWith, - // flake8-commas - rules::flake8_commas::rules::MissingTrailingComma, - rules::flake8_commas::rules::TrailingCommaOnBareTuple, - rules::flake8_commas::rules::ProhibitedTrailingComma, - // flake8-no-pep420 - rules::flake8_no_pep420::rules::ImplicitNamespacePackage, - // flake8-executable - rules::flake8_executable::rules::ShebangNotExecutable, - rules::flake8_executable::rules::ShebangMissingExecutableFile, - rules::flake8_executable::rules::ShebangMissingPython, - rules::flake8_executable::rules::ShebangLeadingWhitespace, - rules::flake8_executable::rules::ShebangNotFirstLine, - // flake8-type-checking - rules::flake8_type_checking::rules::TypingOnlyFirstPartyImport, - rules::flake8_type_checking::rules::TypingOnlyThirdPartyImport, - rules::flake8_type_checking::rules::TypingOnlyStandardLibraryImport, - rules::flake8_type_checking::rules::RuntimeImportInTypeCheckingBlock, - rules::flake8_type_checking::rules::EmptyTypeCheckingBlock, - // tryceratops - rules::tryceratops::rules::RaiseVanillaClass, - rules::tryceratops::rules::RaiseVanillaArgs, - rules::tryceratops::rules::TypeCheckWithoutTypeError, - rules::tryceratops::rules::ReraiseNoCause, - rules::tryceratops::rules::VerboseRaise, - rules::tryceratops::rules::TryConsiderElse, - rules::tryceratops::rules::UselessTryExcept, - rules::tryceratops::rules::RaiseWithinTry, - rules::tryceratops::rules::ErrorInsteadOfException, - rules::tryceratops::rules::VerboseLogMessage, - // flake8-use-pathlib - rules::flake8_use_pathlib::violations::OsPathAbspath, - rules::flake8_use_pathlib::violations::OsChmod, - rules::flake8_use_pathlib::violations::OsMkdir, - rules::flake8_use_pathlib::violations::OsMakedirs, - rules::flake8_use_pathlib::violations::OsRename, - rules::flake8_use_pathlib::violations::PathlibReplace, - rules::flake8_use_pathlib::violations::OsRmdir, - rules::flake8_use_pathlib::violations::OsRemove, - rules::flake8_use_pathlib::violations::OsUnlink, - rules::flake8_use_pathlib::violations::OsGetcwd, - rules::flake8_use_pathlib::violations::OsPathExists, - rules::flake8_use_pathlib::violations::OsPathExpanduser, - rules::flake8_use_pathlib::violations::OsPathIsdir, - rules::flake8_use_pathlib::violations::OsPathIsfile, - rules::flake8_use_pathlib::violations::OsPathIslink, - rules::flake8_use_pathlib::violations::OsReadlink, - rules::flake8_use_pathlib::violations::OsStat, - rules::flake8_use_pathlib::violations::OsPathIsabs, - rules::flake8_use_pathlib::violations::OsPathJoin, - rules::flake8_use_pathlib::violations::OsPathBasename, - rules::flake8_use_pathlib::violations::OsPathDirname, - rules::flake8_use_pathlib::violations::OsPathSamefile, - rules::flake8_use_pathlib::violations::OsPathSplitext, - rules::flake8_use_pathlib::violations::BuiltinOpen, - rules::flake8_use_pathlib::violations::PyPath, - // flake8-logging-format - rules::flake8_logging_format::violations::LoggingStringFormat, - rules::flake8_logging_format::violations::LoggingPercentFormat, - rules::flake8_logging_format::violations::LoggingStringConcat, - rules::flake8_logging_format::violations::LoggingFString, - rules::flake8_logging_format::violations::LoggingWarn, - rules::flake8_logging_format::violations::LoggingExtraAttrClash, - rules::flake8_logging_format::violations::LoggingExcInfo, - rules::flake8_logging_format::violations::LoggingRedundantExcInfo, - // flake8-raise - rules::flake8_raise::rules::UnnecessaryParenOnRaiseException, - // flake8-self - rules::flake8_self::rules::PrivateMemberAccess, - // flake8-gettext - rules::flake8_gettext::rules::FStringInGetTextFuncCall, - rules::flake8_gettext::rules::FormatInGetTextFuncCall, - rules::flake8_gettext::rules::PrintfInGetTextFuncCall, - // numpy - rules::numpy::rules::NumpyDeprecatedTypeAlias, - rules::numpy::rules::NumpyLegacyRandom, - // ruff - rules::ruff::rules::AmbiguousUnicodeCharacterString, - rules::ruff::rules::AmbiguousUnicodeCharacterDocstring, - rules::ruff::rules::AmbiguousUnicodeCharacterComment, - rules::ruff::rules::CollectionLiteralConcatenation, - rules::ruff::rules::AsyncioDanglingTask, - rules::ruff::rules::UnusedNOQA, - rules::ruff::rules::PairwiseOverZipped, - rules::ruff::rules::MutableDataclassDefault, - rules::ruff::rules::FunctionCallInDataclassDefaultArgument, - rules::ruff::rules::ExplicitFStringTypeConversion, - rules::ruff::rules::InvalidPyprojectToml, - // flake8-django - rules::flake8_django::rules::DjangoNullableModelStringField, - rules::flake8_django::rules::DjangoLocalsInRenderFunction, - rules::flake8_django::rules::DjangoExcludeWithModelForm, - rules::flake8_django::rules::DjangoAllWithModelForm, - rules::flake8_django::rules::DjangoModelWithoutDunderStr, - rules::flake8_django::rules::DjangoUnorderedBodyContentInModel, - rules::flake8_django::rules::DjangoNonLeadingReceiverDecorator, - // flynt - rules::flynt::rules::StaticJoinToFString, - // flake8-todo - rules::flake8_todos::rules::InvalidTodoTag, - rules::flake8_todos::rules::MissingTodoAuthor, - rules::flake8_todos::rules::MissingTodoLink, - rules::flake8_todos::rules::MissingTodoColon, - rules::flake8_todos::rules::MissingTodoDescription, - rules::flake8_todos::rules::InvalidTodoCapitalization, - rules::flake8_todos::rules::MissingSpaceAfterTodoColon, - // airflow - rules::airflow::rules::AirflowVariableNameTaskIdMismatch, - // flake8-fixme - rules::flake8_fixme::rules::LineContainsTodo, - rules::flake8_fixme::rules::LineContainsHack, - rules::flake8_fixme::rules::LineContainsXxx, - rules::flake8_fixme::rules::LineContainsFixme, -); - pub trait AsRule { fn rule(&self) -> Rule; } diff --git a/crates/ruff/src/registry/rule_set.rs b/crates/ruff/src/registry/rule_set.rs index 6d38df4c0a..7fdbf8b19d 100644 --- a/crates/ruff/src/registry/rule_set.rs +++ b/crates/ruff/src/registry/rule_set.rs @@ -254,7 +254,7 @@ impl RuleSet { /// /// let iter: Vec<_> = set.iter().collect(); /// - /// assert_eq!(iter, vec![Rule::AmbiguousFunctionName, Rule::AnyType]); + /// assert_eq!(iter, vec![Rule::AnyType, Rule::AmbiguousFunctionName]); /// ``` pub fn iter(&self) -> RuleSetIterator { RuleSetIterator { diff --git a/crates/ruff/src/rule_selector.rs b/crates/ruff/src/rule_selector.rs index b9a135f7d7..bc5a3ee523 100644 --- a/crates/ruff/src/rule_selector.rs +++ b/crates/ruff/src/rule_selector.rs @@ -6,7 +6,8 @@ use strum::IntoEnumIterator; use strum_macros::EnumIter; use crate::codes::RuleCodePrefix; -use crate::registry::{Linter, Rule, RuleIter, RuleNamespace}; +use crate::codes::RuleIter; +use crate::registry::{Linter, Rule, RuleNamespace}; use crate::rule_redirects::get_redirect; #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/crates/ruff_macros/src/lib.rs b/crates/ruff_macros/src/lib.rs index f02a2d1b16..addba01392 100644 --- a/crates/ruff_macros/src/lib.rs +++ b/crates/ruff_macros/src/lib.rs @@ -11,7 +11,6 @@ mod config; mod derive_message_formats; mod map_codes; mod newtype_index; -mod register_rules; mod rule_code_prefix; mod rule_namespace; mod violation; @@ -44,12 +43,6 @@ pub fn cache_key(input: TokenStream) -> TokenStream { TokenStream::from(stream) } -#[proc_macro] -pub fn register_rules(item: TokenStream) -> TokenStream { - let mapping = parse_macro_input!(item as register_rules::Input); - register_rules::register_rules(&mapping).into() -} - /// Adds an `explanation()` method from the doc comment. #[proc_macro_attribute] pub fn violation(_attr: TokenStream, item: TokenStream) -> TokenStream { diff --git a/crates/ruff_macros/src/map_codes.rs b/crates/ruff_macros/src/map_codes.rs index be42309c40..0d4b33643f 100644 --- a/crates/ruff_macros/src/map_codes.rs +++ b/crates/ruff_macros/src/map_codes.rs @@ -10,61 +10,59 @@ use syn::{ use crate::rule_code_prefix::{get_prefix_ident, if_all_same, is_nursery}; -struct LinterToRuleData { - /// The rule identifier, e.g., `Rule::UnaryPrefixIncrement`. - rule_id: Path, - /// The rule group identifiers, e.g., `RuleGroup::Unspecified`. - rule_group_id: Path, - /// The rule attributes. +/// A rule entry in the big match statement such a +/// `(Pycodestyle, "E112") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::NoIndentedBlock),` +#[derive(Clone)] +struct Rule { + /// The actual name of the rule, e.g., `NoIndentedBlock`. + name: Ident, + /// The linter associated with the rule, e.g., `Pycodestyle`. + linter: Ident, + /// The code associated with the rule, e.g., `"E112"`. + code: LitStr, + /// The rule group identifier, e.g., `RuleGroup::Nursery`. + group: Path, + /// The path to the struct implementing the rule, e.g. + /// `rules::pycodestyle::rules::logical_lines::NoIndentedBlock` + path: Path, + /// The rule attributes, e.g. for feature gates attrs: Vec, } -struct RuleToLinterData<'a> { - /// The linter associated with the rule, e.g., `Flake8Bugbear`. - linter: &'a Ident, - /// The code associated with the rule, e.g., `"002"`. - code: &'a str, - /// The rule group identifier, e.g., `RuleGroup::Unspecified`. - rule_group_id: &'a Path, - /// The rule attributes. - attrs: &'a [Attribute], -} - pub(crate) fn map_codes(func: &ItemFn) -> syn::Result { let Some(last_stmt) = func.block.stmts.last() else { return Err(Error::new(func.block.span(), "expected body to end in an expression")); }; - let Stmt::Expr(Expr::Call(ExprCall{args: some_args, ..}), _) = last_stmt else { - return Err(Error::new(last_stmt.span(), "expected last expression to be `Some(match (..) { .. })`")) + let Stmt::Expr(Expr::Call(ExprCall { args: some_args, .. }), _) = last_stmt else { + return Err(Error::new(last_stmt.span(), "expected last expression to be `Some(match (..) { .. })`")); }; let mut some_args = some_args.into_iter(); let (Some(Expr::Match(ExprMatch { arms, .. })), None) = (some_args.next(), some_args.next()) else { - return Err(Error::new(last_stmt.span(), "expected last expression to be `Some(match (..) { .. })`")) + return Err(Error::new(last_stmt.span(), "expected last expression to be `Some(match (..) { .. })`")); }; // Map from: linter (e.g., `Flake8Bugbear`) to rule code (e.g.,`"002"`) to rule data (e.g., // `(Rule::UnaryPrefixIncrement, RuleGroup::Unspecified, vec![])`). - let mut linter_to_rules: BTreeMap> = BTreeMap::new(); + let mut linter_to_rules: BTreeMap> = BTreeMap::new(); for arm in arms { if matches!(arm.pat, Pat::Wild(..)) { break; } - let entry = syn::parse::(arm.into_token_stream().into())?; - linter_to_rules.entry(entry.linter).or_default().insert( - entry.code.value(), - LinterToRuleData { - rule_id: entry.rule, - rule_group_id: entry.group, - attrs: entry.attrs, - }, - ); + let rule = syn::parse::(arm.into_token_stream().into())?; + linter_to_rules + .entry(rule.linter.clone()) + .or_default() + .insert(rule.code.value(), rule); } let linter_idents: Vec<_> = linter_to_rules.keys().collect(); - let mut output = quote! { + let all_rules = linter_to_rules.values().flat_map(BTreeMap::values); + let mut output = register_rules(all_rules); + + output.extend(quote! { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum RuleCodePrefix { #(#linter_idents(#linter_idents),)* @@ -83,21 +81,14 @@ pub(crate) fn map_codes(func: &ItemFn) -> syn::Result { } } } - }; + }); for (linter, rules) in &linter_to_rules { output.extend(super::rule_code_prefix::expand( linter, - rules.iter().map( - |( - code, - LinterToRuleData { - rule_group_id, - attrs, - .. - }, - )| (code.as_str(), rule_group_id, attrs), - ), + rules + .iter() + .map(|(code, Rule { group, attrs, .. })| (code.as_str(), group, attrs)), )); output.extend(quote! { @@ -117,56 +108,7 @@ pub(crate) fn map_codes(func: &ItemFn) -> syn::Result { let mut all_codes = Vec::new(); for (linter, rules) in &linter_to_rules { - // Group the rules by their common prefixes. - // TODO(charlie): Why do we do this here _and_ in `rule_code_prefix::expand`? - let mut rules_by_prefix = BTreeMap::new(); - - for ( - code, - LinterToRuleData { - rule_id, - rule_group_id, - attrs, - }, - ) in rules - { - // Nursery rules have to be explicitly selected, so we ignore them when looking at - // prefixes. - if is_nursery(rule_group_id) { - rules_by_prefix.insert(code.clone(), vec![(rule_id.clone(), attrs.clone())]); - continue; - } - - for i in 1..=code.len() { - let prefix = code[..i].to_string(); - let rules: Vec<_> = rules - .iter() - .filter_map( - |( - code, - LinterToRuleData { - rule_id, - rule_group_id, - attrs, - }, - )| { - // Nursery rules have to be explicitly selected, so we ignore them when - // looking at prefixes. - if is_nursery(rule_group_id) { - return None; - } - - if code.starts_with(&prefix) { - Some((rule_id.clone(), attrs.clone())) - } else { - None - } - }, - ) - .collect(); - rules_by_prefix.insert(prefix, rules); - } - } + let rules_by_prefix = rules_by_prefix(rules); for (prefix, rules) in &rules_by_prefix { let prefix_ident = get_prefix_ident(prefix); @@ -182,9 +124,10 @@ pub(crate) fn map_codes(func: &ItemFn) -> syn::Result { let mut prefix_into_iter_match_arms = quote!(); for (prefix, rules) in rules_by_prefix { - let rule_paths = rules - .iter() - .map(|(path, .., attrs)| quote!(#(#attrs)* #path)); + let rule_paths = rules.iter().map(|(path, .., attrs)| { + let rule_name = path.segments.last().unwrap(); + quote!(#(#attrs)* Rule::#rule_name) + }); let prefix_ident = get_prefix_ident(&prefix); let attr = match if_all_same(rules.iter().map(|(.., attrs)| attrs)) { Some(attr) => quote!(#(#attr)*), @@ -232,35 +175,71 @@ pub(crate) fn map_codes(func: &ItemFn) -> syn::Result { } }); - // Map from rule to codes that can be used to select it. - // This abstraction exists to support a one-to-many mapping, whereby a single rule could map - // to multiple codes (e.g., if it existed in multiple linters, like Pylint and Flake8, under - // different codes). We haven't actually activated this functionality yet, but some work was - // done to support it, so the logic exists here. - let mut rule_to_codes: HashMap<&Path, Vec> = HashMap::new(); + let rule_to_code = generate_rule_to_code(&linter_to_rules); + output.extend(rule_to_code); + + let iter = generate_iter_impl(&linter_to_rules, &all_codes); + output.extend(iter); + + Ok(output) +} + +/// Group the rules by their common prefixes. +fn rules_by_prefix( + rules: &BTreeMap, +) -> BTreeMap)>> { + // TODO(charlie): Why do we do this here _and_ in `rule_code_prefix::expand`? + let mut rules_by_prefix = BTreeMap::new(); + + for (code, rule) in rules { + // Nursery rules have to be explicitly selected, so we ignore them when looking at + // prefixes. + if is_nursery(&rule.group) { + rules_by_prefix.insert(code.clone(), vec![(rule.path.clone(), rule.attrs.clone())]); + continue; + } + + for i in 1..=code.len() { + let prefix = code[..i].to_string(); + let rules: Vec<_> = rules + .iter() + .filter_map(|(code, rule)| { + // Nursery rules have to be explicitly selected, so we ignore them when + // looking at prefixes. + if is_nursery(&rule.group) { + return None; + } + + if code.starts_with(&prefix) { + Some((rule.path.clone(), rule.attrs.clone())) + } else { + None + } + }) + .collect(); + rules_by_prefix.insert(prefix, rules); + } + } + rules_by_prefix +} + +/// Map from rule to codes that can be used to select it. +/// This abstraction exists to support a one-to-many mapping, whereby a single rule could map +/// to multiple codes (e.g., if it existed in multiple linters, like Pylint and Flake8, under +/// different codes). We haven't actually activated this functionality yet, but some work was +/// done to support it, so the logic exists here. +fn generate_rule_to_code(linter_to_rules: &BTreeMap>) -> TokenStream { + let mut rule_to_codes: HashMap<&Path, Vec<&Rule>> = HashMap::new(); let mut linter_code_for_rule_match_arms = quote!(); - for (linter, map) in &linter_to_rules { - for ( - code, - LinterToRuleData { - rule_id, - rule_group_id, - attrs, - }, - ) in map - { - rule_to_codes - .entry(rule_id) - .or_default() - .push(RuleToLinterData { - linter, - code, - rule_group_id, - attrs, - }); + for (linter, map) in linter_to_rules { + for (code, rule) in map { + let Rule { + path, attrs, name, .. + } = rule; + rule_to_codes.entry(path).or_default().push(rule); linter_code_for_rule_match_arms.extend(quote! { - #(#attrs)* (Self::#linter, #rule_id) => Some(#code), + #(#attrs)* (Self::#linter, Rule::#name) => Some(#code), }); } } @@ -269,6 +248,7 @@ pub(crate) fn map_codes(func: &ItemFn) -> syn::Result { let mut rule_group_match_arms = quote!(); for (rule, codes) in rule_to_codes { + let rule_name = rule.segments.last().unwrap(); assert_eq!( codes.len(), 1, @@ -284,30 +264,31 @@ and before we can do that we have to rename all our rules to match our naming co See also https://github.com/charliermarsh/ruff/issues/2186. ", - rule.segments.last().unwrap().ident + rule_name.ident ); - let RuleToLinterData { + let Rule { linter, code, - rule_group_id, + group, attrs, + .. } = codes .iter() - .sorted_by_key(|data| *data.linter == "Pylint") + .sorted_by_key(|data| data.linter == "Pylint") .next() .unwrap(); rule_noqa_code_match_arms.extend(quote! { - #(#attrs)* #rule => NoqaCode(crate::registry::Linter::#linter.common_prefix(), #code), + #(#attrs)* Rule::#rule_name => NoqaCode(crate::registry::Linter::#linter.common_prefix(), #code), }); rule_group_match_arms.extend(quote! { - #(#attrs)* #rule => #rule_group_id, + #(#attrs)* Rule::#rule_name => #group, }); } - output.extend(quote! { + let rule_to_code = quote! { impl Rule { pub fn noqa_code(&self) -> NoqaCode { use crate::registry::RuleNamespace; @@ -338,19 +319,27 @@ See also https://github.com/charliermarsh/ruff/issues/2186. } } } - }); + }; + rule_to_code +} +/// Implement `impl IntoIterator for &Linter` and `RuleCodePrefix::iter()` +fn generate_iter_impl( + linter_to_rules: &BTreeMap>, + all_codes: &[TokenStream], +) -> TokenStream { let mut linter_into_iter_match_arms = quote!(); - for (linter, map) in &linter_to_rules { - let rule_paths = map - .values() - .map(|LinterToRuleData { rule_id, attrs, .. }| quote!(#(#attrs)* #rule_id)); + for (linter, map) in linter_to_rules { + let rule_paths = map.values().map(|Rule { attrs, path, .. }| { + let rule_name = path.segments.last().unwrap(); + quote!(#(#attrs)* Rule::#rule_name) + }); linter_into_iter_match_arms.extend(quote! { Linter::#linter => vec![#(#rule_paths,)*].into_iter(), }); } - output.extend(quote! { + quote! { impl IntoIterator for &Linter { type Item = Rule; type IntoIter = ::std::vec::IntoIter; @@ -362,29 +351,94 @@ See also https://github.com/charliermarsh/ruff/issues/2186. } } - }); - - output.extend(quote! { impl RuleCodePrefix { pub fn iter() -> ::std::vec::IntoIter { vec![ #(#all_codes,)* ].into_iter() } } - }); - - Ok(output) + } } -struct Entry { - linter: Ident, - code: LitStr, - group: Path, - rule: Path, - attrs: Vec, +/// Generate the `Rule` enum +fn register_rules<'a>(input: impl Iterator) -> TokenStream { + let mut rule_variants = quote!(); + let mut rule_message_formats_match_arms = quote!(); + let mut rule_autofixable_match_arms = quote!(); + let mut rule_explanation_match_arms = quote!(); + + let mut from_impls_for_diagnostic_kind = quote!(); + + for Rule { + name, attrs, path, .. + } in input + { + rule_variants.extend(quote! { + #(#attrs)* + #name, + }); + // 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_explanation_match_arms + .extend(quote! {#(#attrs)* Self::#name => #path::explanation(),}); + + // Enable conversion from `DiagnosticKind` to `Rule`. + from_impls_for_diagnostic_kind + .extend(quote! {#(#attrs)* stringify!(#name) => Rule::#name,}); + } + + quote! { + #[derive( + EnumIter, + Debug, + PartialEq, + Eq, + Copy, + Clone, + Hash, + PartialOrd, + Ord, + ::ruff_macros::CacheKey, + AsRefStr, + ::strum_macros::IntoStaticStr, + )] + #[repr(u16)] + #[strum(serialize_all = "kebab-case")] + pub enum Rule { #rule_variants } + + impl Rule { + /// Returns the format strings used to report violations of this rule. + pub fn message_formats(&self) -> &'static [&'static str] { + match self { #rule_message_formats_match_arms } + } + + /// Returns the documentation for this rule. + pub fn explanation(&self) -> Option<&'static str> { + 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 } + } + } + + impl AsRule for ruff_diagnostics::DiagnosticKind { + fn rule(&self) -> Rule { + match self.name.as_str() { + #from_impls_for_diagnostic_kind + _ => unreachable!("invalid rule name: {}", self.name), + } + } + } + } } -impl Parse for Entry { - /// Parses a match arm such as `(Pycodestyle, "E112") => (RuleGroup::Nursery, Rule::NoIndentedBlock),` +impl Parse for Rule { + /// Parses a match arm such as `(Pycodestyle, "E112") => (RuleGroup::Nursery, rules::pycodestyle::rules::logical_lines::NoIndentedBlock),` fn parse(input: syn::parse::ParseStream) -> syn::Result { let attrs = Attribute::parse_outer(input)?; let pat_tuple; @@ -397,13 +451,15 @@ impl Parse for Entry { parenthesized!(pat_tuple in input); let group: Path = pat_tuple.parse()?; let _: Token!(,) = pat_tuple.parse()?; - let rule: Path = pat_tuple.parse()?; + let rule_path: Path = pat_tuple.parse()?; let _: Token!(,) = input.parse()?; - Ok(Entry { + let rule_name = rule_path.segments.last().unwrap().ident.clone(); + Ok(Rule { + name: rule_name, linter, code, group, - rule, + path: rule_path, attrs, }) } diff --git a/crates/ruff_macros/src/register_rules.rs b/crates/ruff_macros/src/register_rules.rs deleted file mode 100644 index 15b0992304..0000000000 --- a/crates/ruff_macros/src/register_rules.rs +++ /dev/null @@ -1,95 +0,0 @@ -use quote::quote; -use syn::parse::Parse; -use syn::{Attribute, Ident, Path, Token}; - -pub(crate) fn register_rules(input: &Input) -> proc_macro2::TokenStream { - let mut rule_variants = quote!(); - let mut rule_message_formats_match_arms = quote!(); - let mut rule_autofixable_match_arms = quote!(); - let mut rule_explanation_match_arms = quote!(); - - let mut from_impls_for_diagnostic_kind = quote!(); - - for (path, name, attr) in &input.entries { - rule_variants.extend(quote! { - #(#attr)* - #name, - }); - // Apply the `attrs` to each arm, like `[cfg(feature = "foo")]`. - rule_message_formats_match_arms - .extend(quote! {#(#attr)* Self::#name => <#path as ruff_diagnostics::Violation>::message_formats(),}); - rule_autofixable_match_arms.extend( - quote! {#(#attr)* Self::#name => <#path as ruff_diagnostics::Violation>::AUTOFIX,}, - ); - rule_explanation_match_arms.extend(quote! {#(#attr)* Self::#name => #path::explanation(),}); - - // Enable conversion from `DiagnosticKind` to `Rule`. - from_impls_for_diagnostic_kind.extend(quote! {#(#attr)* stringify!(#name) => Rule::#name,}); - } - - quote! { - #[derive( - EnumIter, - Debug, - PartialEq, - Eq, - Copy, - Clone, - Hash, - PartialOrd, - Ord, - ::ruff_macros::CacheKey, - AsRefStr, - ::strum_macros::IntoStaticStr, - )] - #[repr(u16)] - #[strum(serialize_all = "kebab-case")] - pub enum Rule { #rule_variants } - - impl Rule { - /// Returns the format strings used to report violations of this rule. - pub fn message_formats(&self) -> &'static [&'static str] { - match self { #rule_message_formats_match_arms } - } - - /// Returns the documentation for this rule. - pub fn explanation(&self) -> Option<&'static str> { - 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 } - } - } - - impl AsRule for ruff_diagnostics::DiagnosticKind { - fn rule(&self) -> Rule { - match self.name.as_str() { - #from_impls_for_diagnostic_kind - _ => unreachable!("invalid rule name: {}", self.name), - } - } - } - } -} - -pub(crate) struct Input { - entries: Vec<(Path, Ident, Vec)>, -} - -impl Parse for Input { - fn parse(input: syn::parse::ParseStream) -> syn::Result { - let mut entries = Vec::new(); - while !input.is_empty() { - // Grab the `#[cfg(...)]` attributes. - let attrs = input.call(Attribute::parse_outer)?; - - let path: Path = input.parse()?; - let name = path.segments.last().unwrap().ident.clone(); - let _: Token![,] = input.parse()?; - entries.push((path, name, attrs)); - } - Ok(Self { entries }) - } -} diff --git a/scripts/add_rule.py b/scripts/add_rule.py index b33b1cf57b..3d1eb14c33 100755 --- a/scripts/add_rule.py +++ b/scripts/add_rule.py @@ -103,8 +103,7 @@ pub struct {name}; impl Violation for {name} {{ #[derive_message_formats] fn message(&self) -> String {{ - todo!("implement message"); - format!("TODO: write message") + format!("TODO: write message: {{}}", todo!("implement message")) }} }} """, @@ -116,56 +115,6 @@ pub(crate) fn {rule_name_snake}(checker: &mut Checker) {{}} """, ) - # Add the relevant code-to-violation pair to `src/registry.rs`. - content = (ROOT_DIR / "crates/ruff/src/registry.rs").read_text() - - seen_macro = False - has_written = False - has_seen_linter = False - with (ROOT_DIR / "crates/ruff/src/registry.rs").open("w") as fp: - lines = [] - for line in content.splitlines(): - if has_written: - fp.write(line) - fp.write("\n") - continue - - if line.startswith("ruff_macros::register_rules!"): - seen_macro = True - fp.write(line) - fp.write("\n") - continue - - if not seen_macro: - fp.write(line) - fp.write("\n") - continue - - if line.strip() == f"// {linter}": - indent = get_indent(line) - lines.append(f"{indent}rules::{dir_name(linter)}::rules::{name},") - has_seen_linter = True - fp.write(line) - fp.write("\n") - continue - - if not has_seen_linter: - fp.write(line) - fp.write("\n") - continue - - if not line.strip().startswith("// "): - lines.append(line) - else: - lines.sort() - fp.write("\n".join(lines)) - fp.write("\n") - fp.write(line) - fp.write("\n") - has_written = True - - assert has_written - text = "" with (ROOT_DIR / "crates/ruff/src/codes.rs").open("r") as fp: while (line := next(fp)).strip() != f"// {linter}": @@ -177,17 +126,15 @@ pub(crate) fn {rule_name_snake}(checker: &mut Checker) {{}} lines.append(line) variant = pascal_case(linter) + rule = f"""rules::{linter.split(" ")[0]}::rules::{name}""" lines.append( " " * 8 - + f"""({variant}, "{code}") => (RuleGroup::Unspecified, Rule::{name}),\n""", + + f"""({variant}, "{code}") => (RuleGroup::Unspecified, {rule}),\n""", ) lines.sort() - text += "".join(lines) text += "\n" - text += fp.read() - with (ROOT_DIR / "crates/ruff/src/codes.rs").open("w") as fp: fp.write(text)