diff --git a/README.md b/README.md index 97f9e44f01b77..c1a947b389d91 100644 --- a/README.md +++ b/README.md @@ -385,8 +385,6 @@ Options: The minimum Python version that should be supported --line-length Set the line-length for length-associated rules and automatic formatting - --max-complexity - Maximum McCabe complexity allowed for a given function --add-noqa Enable automatic additions of `noqa` directives to failing lines --clean diff --git a/ruff_cli/src/cli.rs b/ruff_cli/src/cli.rs index 994edfcca2c72..358254eecf767 100644 --- a/ruff_cli/src/cli.rs +++ b/ruff_cli/src/cli.rs @@ -137,9 +137,6 @@ pub struct Cli { /// formatting. #[arg(long)] pub line_length: Option, - /// Maximum McCabe complexity allowed for a given function. - #[arg(long)] - pub max_complexity: Option, /// Enable automatic additions of `noqa` directives to failing lines. #[arg( long, @@ -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, @@ -332,7 +328,6 @@ pub struct Overrides { pub fixable: Option>, pub ignore: Option>, pub line_length: Option, - pub max_complexity: Option, pub per_file_ignores: Option>, pub respect_gitignore: Option, pub select: Option>, @@ -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())); } diff --git a/src/settings/configuration.rs b/src/settings/configuration.rs index a544fc0c186f8..01d91208f9b01 100644 --- a/src/settings/configuration.rs +++ b/src/settings/configuration.rs @@ -251,12 +251,6 @@ impl Configuration { pyupgrade: self.pyupgrade.or(config.pyupgrade), } } - - pub fn set_max_complexity(&mut self, max_complexity: Option) { - 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