{"record":{"id":"e6db55516dfdd13a","repo":"astral-sh/ruff","slug":"selection-of-deprecated-rules-is-not-allowed-when","errorCode":null,"errorMessage":"Selection of deprecated rules is not allowed when preview is enabled. Remove selection of:","messagePattern":"Selection of deprecated rules is not allowed when preview is enabled\\. Remove selection of:","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff_workspace/src/configuration.rs","lineNumber":1206,"sourceCode":"                    let (prefix, code) = selection.prefix_and_code();\n                    return Err(anyhow!(\n                        \"Selection of deprecated rule `{prefix}{code}` is not allowed when \\\n                         preview is enabled.\"\n                    ));\n                }\n                [..] => {\n                    let mut message = \"\\\n                        Selection of deprecated rules is not allowed \\\n                            when preview is enabled. Remove selection of:\"\n                        .to_string();\n                    for selection in deprecated_selectors {\n                        let (prefix, code) = selection.prefix_and_code();\n                        message.push_str(\"\\n\\t- \");\n                        message.push_str(prefix);\n                        message.push_str(code);\n                    }\n                    message.push('\\n');\n                    return Err(anyhow!(message));\n                }\n            }\n        }\n\n        for selection in ignored_preview_selectors.iter().sorted() {\n            let (prefix, code) = selection.prefix_and_code();\n            warn_user_once_by_message!(\n                \"Selection `{prefix}{code}` has no effect because preview is not enabled.\",\n            );\n        }\n\n        let mut rules = RuleTable::empty();\n\n        for rule in select_set {\n            let fix = fixable_set.contains(rule);\n            rules.enable(rule, fix);\n        }\n","sourceCodeStart":1188,"sourceCodeEnd":1224,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ruff_workspace/src/configuration.rs#L1188-L1224","documentation":"An anyhow error listing all deprecated rules selected in the configuration while preview mode is enabled. It is the multi-rule variant of the single deprecated-rule error and aborts configuration loading until the listed selections are removed.","triggerScenarios":"Thrown at crates/ruff_workspace/src/configuration.rs:1206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove every deprecated rule listed in the message from the configuration","Keep preview mode off until the deprecated rules are dropped"],"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"}