Skip to content

Commit

Permalink
fix default to match pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
diceroll123 committed Dec 16, 2023
1 parent 86ef6e6 commit b72a362
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def func():
# Ok
# 11 is max default
# 15 is max default
first = 1
second = 2
third = 3
Expand All @@ -12,6 +12,10 @@ def func():
ninth = 9
tenth = 10
eleventh = 11
twelveth = 12
thirteenth = 13
fourteenth = 14
fifteenth = 15

def func():
# PLR0914
Expand All @@ -28,3 +32,6 @@ def func():
eleventh = 11
twelfth = 12
thirteenth = 13
fourteenth = 14
fifteenth = 15
sixteenth = 16
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
too_many_locals.py:30:5: PLR0914 Too many local variables: (13/11)
too_many_locals.py:18:5: PLR0914 Too many local variables: (15/11)
|
28 | eleventh = 11
29 | twelfth = 12
30 | thirteenth = 13
16 | thirteenth = 13
17 | fourteenth = 14
18 | fifteenth = 15
| ^ PLR0914
19 |
20 | def func():
|

too_many_locals.py:36:5: PLR0914 Too many local variables: (16/11)
|
34 | thirteenth = 13
35 | fourteenth = 14
36 | fifteenth = 15
| ^ PLR0914
37 | sixteenth = 16
|


2 changes: 1 addition & 1 deletion crates/ruff_workspace/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@ pub struct PylintOptions {

/// Maximum number of local variables allowed for a function or method body (see:
/// `PLR0914`).
#[option(default = r"11", value_type = "int", example = r"max-locals = 11")]
#[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:
Expand Down

0 comments on commit b72a362

Please sign in to comment.