Refactor run_checks.py
This commit is contained in:
parent
dadfc952d1
commit
76fc591fd2
@ -128,25 +128,27 @@ def _check_line(fn):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
args = []
|
def _get_args(checker):
|
||||||
if options['disable']['pylint']:
|
args = []
|
||||||
args += ['--disable=' + ','.join(options['disable']['pylint'])]
|
if checker == 'pylint':
|
||||||
if options['exclude']:
|
try:
|
||||||
args += ['--ignore=' + ','.join(options['exclude'])]
|
args += ['--disable=' + ','.join(options['disable']['pylint'])]
|
||||||
if options['other']['pylint']:
|
args += ['--ignore=' + ','.join(options['exclude'])]
|
||||||
args += options['other']['pylint']
|
args += options['other']['pylint']
|
||||||
run('pylint', args)
|
except KeyError:
|
||||||
|
pass
|
||||||
# FIXME what the hell is the flake8 exit status?
|
elif checker == 'flake8':
|
||||||
args = []
|
try:
|
||||||
if options['disable']['flake8']:
|
args += ['--ignore=' + ','.join(options['disable']['flake8'])]
|
||||||
args += ['--ignore=' + ','.join(options['disable']['flake8'])]
|
args += ['--exclude=' + ','.join(options['exclude'])]
|
||||||
if options['exclude']:
|
args += options['other']['flake8']
|
||||||
args += ['--exclude=' + ','.join(options['exclude'])]
|
except KeyError:
|
||||||
if options['other']['flake8']:
|
pass
|
||||||
args += options['other']['flake8']
|
return args
|
||||||
run('flake8', args)
|
|
||||||
|
|
||||||
|
for checker in ['pylint', 'flake8']:
|
||||||
|
# FIXME what the hell is the flake8 exit status?
|
||||||
|
run(checker, _get_args(checker))
|
||||||
check_line()
|
check_line()
|
||||||
|
|
||||||
print('Exit status values:')
|
print('Exit status values:')
|
||||||
|
Loading…
Reference in New Issue
Block a user