Skip to content

Commit

Permalink
Remove --max-complexity from the CLI (#1877)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 14, 2023
1 parent a81ac67 commit a01edad
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,6 @@ Options:
The minimum Python version that should be supported
--line-length <LINE_LENGTH>
Set the line-length for length-associated rules and automatic formatting
--max-complexity <MAX_COMPLEXITY>
Maximum McCabe complexity allowed for a given function
--add-noqa
Enable automatic additions of `noqa` directives to failing lines
--clean
Expand Down
8 changes: 0 additions & 8 deletions ruff_cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ pub struct Cli {
/// formatting.
#[arg(long)]
pub line_length: Option<usize>,
/// Maximum McCabe complexity allowed for a given function.
#[arg(long)]
pub max_complexity: Option<usize>,
/// Enable automatic additions of `noqa` directives to failing lines.
#[arg(
long,
Expand Down Expand Up @@ -266,7 +263,6 @@ impl Cli {
fixable: self.fixable,
ignore: self.ignore,
line_length: self.line_length,
max_complexity: self.max_complexity,
per_file_ignores: self.per_file_ignores,
respect_gitignore: resolve_bool_arg(
self.respect_gitignore,
Expand Down Expand Up @@ -332,7 +328,6 @@ pub struct Overrides {
pub fixable: Option<Vec<RuleCodePrefix>>,
pub ignore: Option<Vec<RuleCodePrefix>>,
pub line_length: Option<usize>,
pub max_complexity: Option<usize>,
pub per_file_ignores: Option<Vec<PatternPrefixPair>>,
pub respect_gitignore: Option<bool>,
pub select: Option<Vec<RuleCodePrefix>>,
Expand Down Expand Up @@ -383,9 +378,6 @@ impl ConfigProcessor for &Overrides {
if let Some(line_length) = &self.line_length {
config.line_length = Some(*line_length);
}
if let Some(max_complexity) = &self.max_complexity {
config.set_max_complexity(Some(*max_complexity));
}
if let Some(per_file_ignores) = &self.per_file_ignores {
config.per_file_ignores = Some(collect_per_file_ignores(per_file_ignores.clone()));
}
Expand Down
6 changes: 0 additions & 6 deletions src/settings/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,6 @@ impl Configuration {
pyupgrade: self.pyupgrade.or(config.pyupgrade),
}
}

pub fn set_max_complexity(&mut self, max_complexity: Option<usize>) {
let mut mccabe = self.mccabe.take().unwrap_or_default();
mccabe.max_complexity = max_complexity;
self.mccabe = Some(mccabe);
}
}

/// Given a list of source paths, which could include glob patterns, resolve the
Expand Down

0 comments on commit a01edad

Please sign in to comment.