mirror of https://github.com/astral-sh/ruff
Default `max-positional-args` to `max-args` (#8998)
This commit is contained in:
parent
b90027d037
commit
93258e8d5b
|
|
@ -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>,
|
||||
|
||||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue