mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Default max-positional-args
to max-args
(#8998)
This commit is contained in:
parent
b90027d037
commit
93258e8d5b
2 changed files with 4 additions and 1 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue