Refactor run_checks.py
This commit is contained in:
parent
dadfc952d1
commit
76fc591fd2
@ -128,25 +128,27 @@ def _check_line(fn):
|
||||
return False
|
||||
return True
|
||||
|
||||
def _get_args(checker):
|
||||
args = []
|
||||
if options['disable']['pylint']:
|
||||
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:')
|
||||
|
Loading…
Reference in New Issue
Block a user