astral-sh/ruff · error

The following rules have been removed and cannot be…

Error message

The following rules have been removed and cannot be selected:

What it means

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.

Solutions

  1. Delete all removed rule codes listed in the message from the configuration
  2. Substitute the documented replacement rules where applicable
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/ruff_workspace/src/configuration.rs:1152 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/ruff@26f38c119c (2026-09-05). Data as JSON: /api/errors/311888bc6d733a0f. Report an issue: GitHub.

Appendix: source

Thrown at crates/ruff_workspace/src/configuration.rs:1152

        match removed_selectors.as_slice() {
            [] => (),
            [selection] => {
                let (prefix, code) = selection.prefix_and_code();
                return Err(anyhow!(
                    "Rule `{prefix}{code}` was removed and cannot be selected."
                ));
            }
            [..] => {
                let mut message =
                    "The following rules have been removed and cannot be selected:".to_string();
                for selection in removed_selectors {
                    let (prefix, code) = selection.prefix_and_code();
                    message.push_str("\n    - ");
                    message.push_str(prefix);
                    message.push_str(code);
                }
                message.push('\n');
                return Err(anyhow!(message));
            }
        }

        if !removed_ignored_rules.is_empty() {
            let mut rules = String::new();
            for selection in removed_ignored_rules.iter().sorted() {
                let (prefix, code) = selection.prefix_and_code();
                rules.push_str("\n    - ");
                rules.push_str(prefix);
                rules.push_str(code);
            }
            rules.push('\n');
            warn_user_once_by_message!(
                "The following rules have been removed and ignoring them has no effect:{rules}"
            );
        }

        for (from, target) in redirects.iter().sorted_by_key(|item| item.0) {

View on GitHub (pinned to 26f38c119c)