mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
[pylint
] Implement too-many-locals
(PLR0914
) (#9163)
## Summary Implements [`PLR0914` - `too-many-locals`](https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/too-many-locals.html) See #970 ## Test Plan `cargo test`
This commit is contained in:
parent
be8f8e62b5
commit
7c894921df
10 changed files with 149 additions and 0 deletions
|
@ -2703,6 +2703,11 @@ pub struct PylintOptions {
|
|||
#[option(default = r"3", value_type = "int", example = r"max-pos-args = 3")]
|
||||
pub max_positional_args: Option<usize>,
|
||||
|
||||
/// Maximum number of local variables allowed for a function or method body (see:
|
||||
/// `PLR0914`).
|
||||
#[option(default = r"15", value_type = "int", example = r"max-locals = 15")]
|
||||
pub max_locals: Option<usize>,
|
||||
|
||||
/// Maximum number of statements allowed for a function or method body (see:
|
||||
/// `PLR0915`).
|
||||
#[option(default = r"50", value_type = "int", example = r"max-statements = 50")]
|
||||
|
@ -2742,6 +2747,7 @@ impl PylintOptions {
|
|||
max_public_methods: self
|
||||
.max_public_methods
|
||||
.unwrap_or(defaults.max_public_methods),
|
||||
max_locals: self.max_locals.unwrap_or(defaults.max_locals),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue