{"record":{"id":"6782ed46d186ef1a","repo":"astral-sh/ruff","slug":"selection-of-deprecated-rule-prefix-code-is-n","errorCode":null,"errorMessage":"Selection of deprecated rule `{prefix}{code}` is not allowed when preview is enabled.","messagePattern":"Selection of deprecated rule `(.+?)(.+?)` is not allowed when preview is enabled\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_workspace/src/configuration.rs","lineNumber":1180,"sourceCode":"            let (prefix, code) = target.prefix_and_code();\n            // TODO(martin): This belongs into the ruff crate.\n            warn_user_once_by_id!(from, \"`{from}` has been remapped to `{prefix}{code}`.\");\n        }\n\n        if preview.mode.is_disabled() {\n            for selection in deprecated_selectors.iter().sorted() {\n                let (prefix, code) = selection.prefix_and_code();\n                warn_user_once_by_message!(\n                    \"Rule `{prefix}{code}` is deprecated and will be removed in a future release.\"\n                );\n            }\n        } else {\n            let deprecated_selectors = deprecated_selectors.iter().sorted().collect::<Vec<_>>();\n            match deprecated_selectors.as_slice() {\n                [] => (),\n                [selection] => {\n                    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                }","sourceCodeStart":1162,"sourceCodeEnd":1198,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/ruff_workspace/src/configuration.rs#L1162-L1198","documentation":"Error \"Selection of deprecated rule `{prefix}{code}` is not allowed when preview is enabled.\" thrown in astral-sh/ruff.","triggerScenarios":"Thrown at crates/ruff_workspace/src/configuration.rs:1180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}