diff --git a/crates/ruff_workspace/src/configuration.rs b/crates/ruff_workspace/src/configuration.rs index 7a882fa3f1ffa..5d95fac9d01f2 100644 --- a/crates/ruff_workspace/src/configuration.rs +++ b/crates/ruff_workspace/src/configuration.rs @@ -604,7 +604,6 @@ pub struct LintConfiguration { pub logger_objects: Option>, pub task_tags: Option>, pub typing_modules: Option>, - pub allowed_unused_imports: Option>, // Plugins pub flake8_annotations: Option, @@ -717,7 +716,7 @@ impl LintConfiguration { task_tags: options.common.task_tags, logger_objects: options.common.logger_objects, typing_modules: options.common.typing_modules, - allowed_unused_imports: options.common.allowed_unused_imports, + // Plugins flake8_annotations: options.common.flake8_annotations, flake8_bandit: options.common.flake8_bandit, @@ -1086,9 +1085,7 @@ impl LintConfiguration { .or(config.explicit_preview_rules), task_tags: self.task_tags.or(config.task_tags), typing_modules: self.typing_modules.or(config.typing_modules), - allowed_unused_imports: self - .allowed_unused_imports - .or(config.allowed_unused_imports), + // Plugins flake8_annotations: self.flake8_annotations.combine(config.flake8_annotations), flake8_bandit: self.flake8_bandit.combine(config.flake8_bandit), @@ -1310,7 +1307,6 @@ fn warn_about_deprecated_top_level_lint_options( explicit_preview_rules, task_tags, typing_modules, - allowed_unused_imports, unfixable, flake8_annotations, flake8_bandit, @@ -1409,9 +1405,6 @@ fn warn_about_deprecated_top_level_lint_options( if typing_modules.is_some() { used_options.push("typing-modules"); } - if allowed_unused_imports.is_some() { - used_options.push("allowed-unused-imports"); - } if unfixable.is_some() { used_options.push("unfixable"); diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 00c562b6d16c5..6e87221f4be2c 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -785,16 +785,6 @@ pub struct LintCommonOptions { )] pub typing_modules: Option>, - /// A list of modules which is allowed even though they are not used - /// in the code. - /// - /// This is useful when a module has a side effect when imported. - #[option( - default = r#"[]"#, - value_type = "list[str]", - example = r#"allowed-unused-imports = ["hvplot.pandas"]"# - )] - pub allowed_unused_imports: Option>, /// A list of rule codes or prefixes to consider non-fixable. #[option( default = "[]", diff --git a/ruff.schema.json b/ruff.schema.json index eb8b422cc038b..3f3cdefae955c 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -16,17 +16,6 @@ "minLength": 1 } }, - "allowed-unused-imports": { - "description": "A list of modules which is allowed even though they are not used in the code.\n\nThis is useful when a module has a side effect when imported.", - "deprecated": true, - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - }, "analyze": { "description": "Options to configure import map generation.", "anyOf": [ @@ -1886,16 +1875,6 @@ "minLength": 1 } }, - "allowed-unused-imports": { - "description": "A list of modules which is allowed even though they are not used in the code.\n\nThis is useful when a module has a side effect when imported.", - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - }, "dummy-variable-rgx": { "description": "A regular expression used to identify \"dummy\" variables, or those which should be ignored when enforcing (e.g.) unused-variable rules. The default expression matches `_`, `__`, and `_var`, but not `_var_`.", "type": [