Skip to content

Commit

Permalink
Remove allow-unused-imports setting from the common lint options (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored and AlexWaygood committed Oct 17, 2024
1 parent 1b79ae9 commit 9218d6b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
11 changes: 2 additions & 9 deletions crates/ruff_workspace/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,6 @@ pub struct LintConfiguration {
pub logger_objects: Option<Vec<String>>,
pub task_tags: Option<Vec<String>>,
pub typing_modules: Option<Vec<String>>,
pub allowed_unused_imports: Option<Vec<String>>,

// Plugins
pub flake8_annotations: Option<Flake8AnnotationsOptions>,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Expand Down
10 changes: 0 additions & 10 deletions crates/ruff_workspace/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,16 +785,6 @@ pub struct LintCommonOptions {
)]
pub typing_modules: Option<Vec<String>>,

/// 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<Vec<String>>,
/// A list of rule codes or prefixes to consider non-fixable.
#[option(
default = "[]",
Expand Down
21 changes: 0 additions & 21 deletions ruff.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9218d6b

Please sign in to comment.