Commit 32b9c287 authored by Jérome Perrin's avatar Jérome Perrin

WIP new pylint

parent a20bcb60
...@@ -547,7 +547,8 @@ def checkPythonSourceCode(source_code_str, portal_type=None): ...@@ -547,7 +547,8 @@ def checkPythonSourceCode(source_code_str, portal_type=None):
# unused variables # unused variables
'--dummy-variables-rgx=_$|dummy|__traceback_info__|__traceback_supplement__', '--dummy-variables-rgx=_$|dummy|__traceback_info__|__traceback_supplement__',
] ]
if six.PY3:
args.append("--msg-template='{C}: {line},{column}: {msg} ({symbol})'")
if portal_type == 'Interface Component': if portal_type == 'Interface Component':
# __init__ method from base class %r is not called # __init__ method from base class %r is not called
args.append('--disable=W0231') args.append('--disable=W0231')
...@@ -571,8 +572,13 @@ def checkPythonSourceCode(source_code_str, portal_type=None): ...@@ -571,8 +572,13 @@ def checkPythonSourceCode(source_code_str, portal_type=None):
# dynamic modules from ZODB. # dynamic modules from ZODB.
Run(args, reporter=TextReporter(output_file), exit=False) Run(args, reporter=TextReporter(output_file), exit=False)
finally: finally:
if six.PY2:
from astroid.builder import MANAGER from astroid.builder import MANAGER
MANAGER.astroid_cache.pop( astroid_cache = MANAGER.astroid_cache
else:
from astroid.manager import AstroidManager
astroid_cache = AstroidManager().astroid_cache
astroid_cache.pop(
os.path.splitext(os.path.basename(input_file.name))[0], os.path.splitext(os.path.basename(input_file.name))[0],
None) None)
......
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