summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-02-04 13:42:25 +0100
committerMichal Minar <miminar@redhat.com>2013-02-04 14:51:03 +0100
commitba52a771a8fc423f6e2fa6f85145da22778c761f (patch)
tree602774e8039c07d82e9627b98d231d949a46da20
parent3ad1feb54e489bffd2cb6ff2bf89a6669f1e4cdd (diff)
downloadopenlmi-providers-0.0.18.tar.gz
openlmi-providers-0.0.18.tar.xz
openlmi-providers-0.0.18.zip
fixed pylint plugins0.0.18
Marking of line positions for error suppression needed finetuning in other to make them more robust. They did not work for multiline statements like decorated functions/methods etc.
-rw-r--r--src/python/openlmi/__init__.pycbin246 -> 0 bytes
-rw-r--r--tools/pylint/plugins/cim_provider_checker.py13
2 files changed, 7 insertions, 6 deletions
diff --git a/src/python/openlmi/__init__.pyc b/src/python/openlmi/__init__.pyc
deleted file mode 100644
index d7131d7..0000000
--- a/src/python/openlmi/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/tools/pylint/plugins/cim_provider_checker.py b/tools/pylint/plugins/cim_provider_checker.py
index 8ce775b..b1b1ae9 100644
--- a/tools/pylint/plugins/cim_provider_checker.py
+++ b/tools/pylint/plugins/cim_provider_checker.py
@@ -46,9 +46,9 @@ def recursively_clean_cls_values(linter, node):
Supress them for any nested class recursively.
"""
# class has too few public methods
- linter.disable('R0903', scope='module', line=node.lineno)
+ linter.disable('R0903', scope='module', line=node.fromlineno)
# class has not docstring
- linter.disable('C0111', scope='module', line=node.lineno)
+ linter.disable('C0111', scope='module', line=node.fromlineno)
for child in node.get_children():
if isinstance(child, scoped_nodes.Class):
recursively_clean_cls_values(linter, child)
@@ -60,10 +60,10 @@ def supress_cim_provider_messages(linter, node):
"""
assert isinstance(node, scoped_nodes.Class)
# class has too many public methods
- linter.disable('R0904', scope='module', line=node.lineno)
+ linter.disable('R0904', scope='module', line=node.fromlineno)
if '__init__' in node:
# __init__ not called for base class
- linter.disable('W0231', scope='module', line=node['__init__'].lineno)
+ linter.disable('W0231', scope='module', line=node['__init__'].fromlineno)
if ( 'Values' in node
and isinstance(node['Values'], scoped_nodes.Class)):
recursively_clean_cls_values(linter, node['Values'])
@@ -79,9 +79,10 @@ def supress_cim_provider_messages(linter, node):
or ( child.name not in generated_methods
and not child.name.startswith('cim_method_'))):
continue
- linter.disable('R0201', scope='module', line=node.lineno)
+ # provider method could be a function
+ linter.disable('R0201', scope='module', line=child.fromlineno)
for arg in child.args.get_children():
- linter.disable('W0613', scope='module', line=arg.lineno)
+ linter.disable('W0613', scope='module', line=arg.fromlineno)
class CIMProviderChecker(BaseChecker):
"""