summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/dev/misc_checks.py27
-rw-r--r--tox.ini5
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
diff --git a/tox.ini b/tox.ini
index bfc1f2b49..a00122333 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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}