Skip to content

Commit

Permalink
Default max-positional-args to max-args
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Dec 4, 2023
1 parent b90027d commit 93b3b33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/ruff_workspace/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2637,6 +2637,8 @@ pub struct PylintOptions {

/// Maximum number of positional arguments allowed for a function or method definition
/// (see: `PLR0917`).
///
/// If not specified, defaults to the value of `max-args`.
#[option(default = r"3", value_type = "int", example = r"max-pos-args = 3")]
pub max_positional_args: Option<usize>,

Expand Down Expand Up @@ -2670,6 +2672,7 @@ impl PylintOptions {
max_args: self.max_args.unwrap_or(defaults.max_args),
max_positional_args: self
.max_positional_args
.or(self.max_args)
.unwrap_or(defaults.max_positional_args),
max_bool_expr: self.max_bool_expr.unwrap_or(defaults.max_bool_expr),
max_returns: self.max_returns.unwrap_or(defaults.max_returns),
Expand Down

0 comments on commit 93b3b33

Please sign in to comment.