'unused' prefix to suppress warnings of unused variables

In addition to '_', also ignore any unused variables whose name start
with 'unused', as recommended by http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Lint#Lint
parent cca0047a
...@@ -634,7 +634,7 @@ def check_definitions(flow, compiler_directives): ...@@ -634,7 +634,7 @@ def check_definitions(flow, compiler_directives):
for entry in flow.entries: for entry in flow.entries:
if (not entry.cf_references if (not entry.cf_references
and not entry.is_pyclass_attr): and not entry.is_pyclass_attr):
if not entry.name.startswith('_'): if entry.name != '_' and not entry.name.startswith('unused'):
# '_' is often used for unused variables, e.g. in loops # '_' is often used for unused variables, e.g. in loops
if entry.is_arg: if entry.is_arg:
if warn_unused_arg: if warn_unused_arg:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment