diff options
author | Andy Young <a7young@ucsd.edu> | 2022-05-03 08:32:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 17:32:26 +0200 |
commit | 6aa336f529de03a170d9538dcd5f581109f9dd9e (patch) | |
tree | d70eced9d5de1860e54a22f69efec30b3bc3f170 /pylint/checkers | |
parent | f2f3182150008e152009d94098143192a83d3faf (diff) | |
download | pylint-git-6aa336f529de03a170d9538dcd5f581109f9dd9e.tar.gz |
Ignore underscore as a local variable (#6492)
Diffstat (limited to 'pylint/checkers')
-rw-r--r-- | pylint/checkers/design_analysis.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pylint/checkers/design_analysis.py b/pylint/checkers/design_analysis.py index 550853b05..1ed19be78 100644 --- a/pylint/checkers/design_analysis.py +++ b/pylint/checkers/design_analysis.py @@ -536,6 +536,11 @@ class MisdesignChecker(BaseChecker): ignored_args_num = 0 # check number of local variables locnum = len(node.locals) - ignored_args_num + + # decrement number of local variables if '_' is one of them + if "_" in node.locals: + locnum -= 1 + if locnum > self.linter.config.max_locals: self.add_message( "too-many-locals", |