diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-11-02 16:29:02 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-11-02 16:29:02 +0100 |
commit | 0a5c2114c1f74c7bcad6ff67f64c0d683497657b (patch) | |
tree | 838a532ab888b5b68640b55e92717ca3730c71f8 | |
parent | ab4b7dbbd669ae89a54da5744e4ffc970285dc44 (diff) | |
download | qutebrowser-0a5c2114c1f74c7bcad6ff67f64c0d683497657b.tar.gz qutebrowser-0a5c2114c1f74c7bcad6ff67f64c0d683497657b.zip |
scripts: Add 'all' to misc_checks
-rw-r--r-- | scripts/dev/misc_checks.py | 27 | ||||
-rw-r--r-- | tox.ini | 5 |
2 files changed, 19 insertions, 13 deletions
diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py index df2845405..7058e168f 100644 --- a/scripts/dev/misc_checks.py +++ b/scripts/dev/misc_checks.py @@ -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 @@ -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} |