run_checks: Add main block
This commit is contained in:
parent
2d1f84e7f0
commit
01ec30cda3
@ -221,27 +221,32 @@ def _get_args(checker):
|
|||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
argv = sys.argv[:]
|
def main():
|
||||||
check_unittest()
|
argv = sys.argv[:]
|
||||||
check_git()
|
check_unittest()
|
||||||
for trg in CONFIG.get('DEFAULT', 'targets').split(','):
|
check_git()
|
||||||
print("==================== {} ====================".format(trg))
|
for trg in CONFIG.get('DEFAULT', 'targets').split(','):
|
||||||
check_pep257(trg, _get_args('pep257'))
|
print("==================== {} ====================".format(trg))
|
||||||
for chk in ('pylint', 'flake8'):
|
check_pep257(trg, _get_args('pep257'))
|
||||||
# FIXME what the hell is the flake8 exit status?
|
for chk in ('pylint', 'flake8'):
|
||||||
run(chk, trg, _get_args(chk))
|
# FIXME what the hell is the flake8 exit status?
|
||||||
check_vcs_conflict(trg)
|
run(chk, trg, _get_args(chk))
|
||||||
|
check_vcs_conflict(trg)
|
||||||
|
|
||||||
if '--setup' in argv:
|
if '--setup' in argv:
|
||||||
print("==================== Setup checks ====================")
|
print("==================== Setup checks ====================")
|
||||||
for chk in ('pyroma', 'check-manifest'):
|
for chk in ('pyroma', 'check-manifest'):
|
||||||
run(chk, args=_get_args(chk))
|
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))
|
||||||
|
|
||||||
if all(val in (True, 0) for val in status):
|
if all(val in (True, 0) for val in status):
|
||||||
sys.exit(0)
|
return 0
|
||||||
else:
|
else:
|
||||||
sys.exit(1)
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main())
|
||||||
|
Loading…
Reference in New Issue
Block a user