Skip to content

Commit 93258e8

Browse files
Default max-positional-args to max-args (#8998)
1 parent b90027d commit 93258e8

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

crates/ruff_workspace/src/options.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,6 +2637,8 @@ pub struct PylintOptions {
26372637

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

@@ -2670,6 +2672,7 @@ impl PylintOptions {
26702672
max_args: self.max_args.unwrap_or(defaults.max_args),
26712673
max_positional_args: self
26722674
.max_positional_args
2675+
.or(self.max_args)
26732676
.unwrap_or(defaults.max_positional_args),
26742677
max_bool_expr: self.max_bool_expr.unwrap_or(defaults.max_bool_expr),
26752678
max_returns: self.max_returns.unwrap_or(defaults.max_returns),

ruff.schema.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)