Run pyroma/check-manifest correctly in run_checks
This commit is contained in:
parent
dc0ad4111e
commit
be446b6607
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
""" Run different codecheckers over a codebase.
|
""" Run different codecheckers over a codebase.
|
||||||
|
|
||||||
Runs flake8, pylint, pep257, a CRLF/whitespace/conflict-checker and pyroma by
|
Runs flake8, pylint, pep257, a CRLF/whitespace/conflict-checker and
|
||||||
default.
|
pyroma/check-manifest by default.
|
||||||
|
|
||||||
Module attributes:
|
Module attributes:
|
||||||
status: An OrderedDict for return status values.
|
status: An OrderedDict for return status values.
|
||||||
@ -74,7 +74,7 @@ if os.name == 'nt':
|
|||||||
options['exclude_pep257'].append('configdata.py')
|
options['exclude_pep257'].append('configdata.py')
|
||||||
|
|
||||||
|
|
||||||
def run(name, target, args=None):
|
def run(name, target=None, args=None):
|
||||||
"""Run a checker via distutils with optional args.
|
"""Run a checker via distutils with optional args.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
@ -83,11 +83,11 @@ def run(name, target, args=None):
|
|||||||
args: Option list of arguments to pass
|
args: Option list of arguments to pass
|
||||||
"""
|
"""
|
||||||
sys.argv = [name]
|
sys.argv = [name]
|
||||||
status_key = '{}_{}'.format(name, target)
|
if target is None:
|
||||||
if name != 'pyroma':
|
status_key = name
|
||||||
|
else:
|
||||||
|
status_key = '{}_{}'.format(name, target)
|
||||||
args.append(target)
|
args.append(target)
|
||||||
elif name == 'pyroma' and target != 'qutebrowser':
|
|
||||||
return
|
|
||||||
if args is not None:
|
if args is not None:
|
||||||
sys.argv += args
|
sys.argv += args
|
||||||
print("------ {} ------".format(name))
|
print("------ {} ------".format(name))
|
||||||
@ -222,19 +222,27 @@ def _get_args(checker):
|
|||||||
pass
|
pass
|
||||||
elif checker == 'pyroma':
|
elif checker == 'pyroma':
|
||||||
args = ['.']
|
args = ['.']
|
||||||
|
elif checker == 'check-manifest':
|
||||||
|
args = []
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
argv = sys.argv[:]
|
||||||
check_unittest()
|
check_unittest()
|
||||||
for trg in options['targets']:
|
for trg in options['targets']:
|
||||||
print("==================== {} ====================".format(trg))
|
print("==================== {} ====================".format(trg))
|
||||||
if do_check_257:
|
if do_check_257:
|
||||||
check_pep257(trg, _get_args('pep257'))
|
check_pep257(trg, _get_args('pep257'))
|
||||||
for chk in ['pylint', 'flake8', 'pyroma']:
|
for chk in ['pylint', 'flake8']:
|
||||||
# FIXME what the hell is the flake8 exit status?
|
# FIXME what the hell is the flake8 exit status?
|
||||||
run(chk, trg, _get_args(chk))
|
run(chk, trg, _get_args(chk))
|
||||||
check_line(trg, )
|
check_line(trg, )
|
||||||
|
|
||||||
|
if '--setup' in argv:
|
||||||
|
print("==================== Setup checks ====================")
|
||||||
|
for chk in ['pyroma', 'check-manifest']:
|
||||||
|
run(chk, args=_get_args(chk))
|
||||||
|
|
||||||
print("Exit status values:")
|
print("Exit status values:")
|
||||||
for (k, v) in status.items():
|
for (k, v) in status.items():
|
||||||
print(' {} - {}'.format(k, v))
|
print(' {} - {}'.format(k, v))
|
||||||
|
Loading…
Reference in New Issue
Block a user