diff options
author | Torsten Marek <tmarek@google.com> | 2013-06-18 09:51:29 +0200 |
---|---|---|
committer | Torsten Marek <tmarek@google.com> | 2013-06-18 09:51:29 +0200 |
commit | e7670dfa2173b5b8a3d99fd3d4f26f7e9e4fbc41 (patch) | |
tree | f40f53324039165f5b4f3f8f1d35e4b26832b272 | |
parent | ad7b0027ce59c7091a3dc0c45c184c265e825521 (diff) | |
download | pylint-e7670dfa2173b5b8a3d99fd3d4f26f7e9e4fbc41.tar.gz |
Do not treat all variables starting with _ as dummy variables, only _.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | checkers/variables.py | 2 | ||||
-rw-r--r-- | test/input/func_too_many_locals_arguments.py | 2 |
3 files changed, 5 insertions, 1 deletions
@@ -2,6 +2,8 @@ ChangeLog for Pylint ==================== -- + * Do not treat all variables starting with _ as dummy variables, + only _ itself. * Make the line-too-long warning configurable by adding a regex for lines for with the length limit should not be enforced diff --git a/checkers/variables.py b/checkers/variables.py index 7f012f7..b50ba08 100644 --- a/checkers/variables.py +++ b/checkers/variables.py @@ -140,7 +140,7 @@ class VariablesChecker(BaseChecker): 'help' : 'Tells whether we should check for unused import in \ __init__ files.'}), ("dummy-variables-rgx", - {'default': ('_|dummy'), + {'default': ('_$|dummy'), 'type' :'regexp', 'metavar' : '<regexp>', 'help' : 'A regular expression matching the beginning of \ the name of dummy variables (i.e. not used).'}), diff --git a/test/input/func_too_many_locals_arguments.py b/test/input/func_too_many_locals_arguments.py index 95ef771..f63a5ee 100644 --- a/test/input/func_too_many_locals_arguments.py +++ b/test/input/func_too_many_locals_arguments.py @@ -47,4 +47,6 @@ def ignored_arguments_function(arga, argu, argi, arg8 = arg7 * 8 arg9 = arg8 * 9 arg9 += arg0 + if _args: + arg9 += sum(_args) return arg9 |