diff options
author | Michal Minar <miminar@redhat.com> | 2013-01-24 14:14:30 +0100 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2013-01-24 14:14:30 +0100 |
commit | b2044c554f4343abaa31f843fdc6b8a445cbff96 (patch) | |
tree | 99dd64c4f6416e2da569d2526517927e1ac794ae /tools | |
parent | ac4b92c339a8db0634637360cdc8637e9223f457 (diff) | |
download | openlmi-providers-b2044c554f4343abaa31f843fdc6b8a445cbff96.tar.gz openlmi-providers-b2044c554f4343abaa31f843fdc6b8a445cbff96.tar.xz openlmi-providers-b2044c554f4343abaa31f843fdc6b8a445cbff96.zip |
made pylint more friendly
allow arguments 2 characters long
allow any arguments in provider methods to be unused
- support functions spawning its arguments on multiple lines
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pylint/plugins/cim_provider_checker.py | 10 | ||||
-rw-r--r-- | tools/pylint/pylintrc | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/pylint/plugins/cim_provider_checker.py b/tools/pylint/plugins/cim_provider_checker.py index 6dd09db..cf4e229 100644 --- a/tools/pylint/plugins/cim_provider_checker.py +++ b/tools/pylint/plugins/cim_provider_checker.py @@ -75,12 +75,12 @@ def supress_cim_provider_messages(linter, node): 'delete_instance') # implementation of generated methods may not use all arguments for child in node.get_children(): - if not isinstance(child, scoped_nodes.Function): + if ( not isinstance(child, scoped_nodes.Function) + or ( child.name not in generated_methods + and not child.name.startswith('cim_method_'))): continue - if (child.name in generated_methods - or child.name.startswith('cim_method_')): - linter.disable('W0613', scope='module', - line=child.lineno) + for arg in child.args.get_children(): + linter.disable('W0613', scope='module', line=arg.lineno) class CIMProviderChecker(BaseChecker): """ diff --git a/tools/pylint/pylintrc b/tools/pylint/pylintrc index b557774..82446d0 100644 --- a/tools/pylint/pylintrc +++ b/tools/pylint/pylintrc @@ -131,7 +131,7 @@ method-rgx=[a-z_][a-z0-9_]{2,49}$ attr-rgx=[a-z_][a-z0-9_]{2,30}$ # Regular expression which should only match correct argument names -argument-rgx=[a-z_][a-z0-9_]{2,30}$ +argument-rgx=[a-z_][a-z0-9_]{1,30}$ # Regular expression which should only match correct variable names variable-rgx=[a-z_][a-z0-9_]{1,30}$ |