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