Skip to content

Commit

Permalink
Default max-positional-args to max-args (#8998)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Dec 4, 2023
1 parent b90027d commit 93258e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion ruff.schema.json

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

0 comments on commit 93258e8

Please sign in to comment.