diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index f87a5223d9aed..442b8d7d2e16d 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -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, @@ -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), diff --git a/ruff.schema.json b/ruff.schema.json index d962edc15e141..3bd21232a2551 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -2370,7 +2370,7 @@ "minimum": 0.0 }, "max-positional-args": { - "description": "Maximum number of positional arguments allowed for a function or method definition (see: `PLR0917`).", + "description": "Maximum number of positional arguments allowed for a function or method definition (see: `PLR0917`).\n\nIf not specified, defaults to the value of `max-args`.", "type": [ "integer", "null"