scripts: Add 'all' to misc_checks

This commit is contained in:
Florian Bruhin 2020-11-02 16:29:02 +01:00
parent ab4b7dbbd6
commit 0a5c2114c1
2 changed files with 19 additions and 13 deletions

View File

@ -203,20 +203,29 @@ def check_userscripts_descriptions(_args: argparse.Namespace = None) -> bool:
def main() -> int:
checkers = {
'git': check_git,
'vcs': check_vcs_conflict,
'spelling': check_spelling,
'userscripts': check_userscripts_descriptions,
}
parser = argparse.ArgumentParser()
parser.add_argument('--verbose', action='store_true', help='Show checked filenames')
parser.add_argument('checker',
choices=('git', 'vcs', 'spelling', 'userscripts'),
choices=list(checkers) + ['all'],
help="Which checker to run.")
args = parser.parse_args()
if args.checker == 'git':
ok = check_git(args)
elif args.checker == 'vcs':
ok = check_vcs_conflict(args)
elif args.checker == 'spelling':
ok = check_spelling(args)
elif args.checker == 'userscripts':
ok = check_userscripts_descriptions(args)
if args.checker == 'all':
retvals = []
for name, checker in checkers.items():
utils.print_title(name)
retvals.append(checker(args))
return 0 if all(retvals) else 1
checker = checkers[args.checker]
ok = checker(args)
return 0 if ok else 1

View File

@ -50,10 +50,7 @@ pip_version = pip
passenv = HOME
deps =
commands =
{envpython} scripts/dev/misc_checks.py git
{envpython} scripts/dev/misc_checks.py vcs
{envpython} scripts/dev/misc_checks.py spelling
{envpython} scripts/dev/misc_checks.py userscripts
{envpython} scripts/dev/misc_checks.py all
[testenv:vulture]
basepython = {env:PYTHON:python3}