Refactor run_checks.py

This commit is contained in:
Florian Bruhin 2014-02-07 19:39:55 +01:00
parent dadfc952d1
commit 76fc591fd2

View File

@ -128,25 +128,27 @@ def _check_line(fn):
return False
return True
args = []
if options['disable']['pylint']:
def _get_args(checker):
args = []
if checker == 'pylint':
try:
args += ['--disable=' + ','.join(options['disable']['pylint'])]
if options['exclude']:
args += ['--ignore=' + ','.join(options['exclude'])]
if options['other']['pylint']:
args += options['other']['pylint']
run('pylint', args)
# FIXME what the hell is the flake8 exit status?
args = []
if options['disable']['flake8']:
except KeyError:
pass
elif checker == 'flake8':
try:
args += ['--ignore=' + ','.join(options['disable']['flake8'])]
if options['exclude']:
args += ['--exclude=' + ','.join(options['exclude'])]
if options['other']['flake8']:
args += options['other']['flake8']
run('flake8', args)
except KeyError:
pass
return args
for checker in ['pylint', 'flake8']:
# FIXME what the hell is the flake8 exit status?
run(checker, _get_args(checker))
check_line()
print('Exit status values:')