[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:
Steve C 2023-12-18 15:00:04 -05:00 committed by GitHub
parent be8f8e62b5
commit 7c894921df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 149 additions and 0 deletions

View file

@ -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),
}
}
}