{"record":{"id":"311888bc6d733a0f","repo":"astral-sh/ruff","slug":"the-following-rules-have-been-removed-and-cannot-b","errorCode":null,"errorMessage":"The following rules have been removed and cannot be selected:","messagePattern":"The following rules have been removed and cannot be selected:","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff_workspace/src/configuration.rs","lineNumber":1152,"sourceCode":"        match removed_selectors.as_slice() {\n            [] => (),\n            [selection] => {\n                let (prefix, code) = selection.prefix_and_code();\n                return Err(anyhow!(\n                    \"Rule `{prefix}{code}` was removed and cannot be selected.\"\n                ));\n            }\n            [..] => {\n                let mut message =\n                    \"The following rules have been removed and cannot be selected:\".to_string();\n                for selection in removed_selectors {\n                    let (prefix, code) = selection.prefix_and_code();\n                    message.push_str(\"\\n    - \");\n                    message.push_str(prefix);\n                    message.push_str(code);\n                }\n                message.push('\\n');\n                return Err(anyhow!(message));\n            }\n        }\n\n        if !removed_ignored_rules.is_empty() {\n            let mut rules = String::new();\n            for selection in removed_ignored_rules.iter().sorted() {\n                let (prefix, code) = selection.prefix_and_code();\n                rules.push_str(\"\\n    - \");\n                rules.push_str(prefix);\n                rules.push_str(code);\n            }\n            rules.push('\\n');\n            warn_user_once_by_message!(\n                \"The following rules have been removed and ignoring them has no effect:{rules}\"\n            );\n        }\n\n        for (from, target) in redirects.iter().sorted_by_key(|item| item.0) {","sourceCodeStart":1134,"sourceCodeEnd":1170,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ruff_workspace/src/configuration.rs#L1134-L1170","documentation":"An anyhow error listing every rule code in the configuration that was removed from Ruff and therefore cannot be selected. It is the multi-rule variant of the single-code error, emitted when more than one removed selector is present.","triggerScenarios":"Thrown at crates/ruff_workspace/src/configuration.rs:1152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete all removed rule codes listed in the message from the configuration","Substitute the documented replacement rules where applicable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}