{"record":{"id":"f33defeffe15e30f","repo":"astral-sh/ruff","slug":"rule-prefix-code-was-removed-and-cannot-be-se","errorCode":null,"errorMessage":"Rule `{prefix}{code}` was removed and cannot be selected.","messagePattern":"Rule `(.+?)(.+?)` was removed and cannot be selected\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff_workspace/src/configuration.rs","lineNumber":1138,"sourceCode":"                    redirected_from: Some(redirect_from),\n                    ..\n                }\n                | RuleSelector::Rule {\n                    redirected_from: Some(redirect_from),\n                    ..\n                } = selector\n                {\n                    redirects.insert(*redirect_from, selector);\n                }\n            }\n        }\n\n        let removed_selectors = removed_selectors.iter().sorted().collect::<Vec<_>>();\n        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() {","sourceCodeStart":1120,"sourceCodeEnd":1156,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ruff_workspace/src/configuration.rs#L1120-L1156","documentation":"An anyhow error raised during rule-table resolution: the configuration selects a single rule code that was removed from Ruff in an earlier release. Removed rules cannot be re-enabled, so configuration loading fails with this message naming the offending code.","triggerScenarios":"Thrown at crates/ruff_workspace/src/configuration.rs:1138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the removed rule code from select/ignore in the configuration","Replace the removed rule with its documented successor, if one exists"],"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"}