From 93b3b338e8b12527295c02e0c6e9eef25d6947bf Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 4 Dec 2023 13:50:52 -0500 Subject: [PATCH] Default max-positional-args to max-args --- crates/ruff_workspace/src/options.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index f87a5223d9aedc..442b8d7d2e16d6 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),