aboutsummaryrefslogtreecommitdiff
path: root/test/lint/all-lint.py
diff options
context:
space:
mode:
authorMartin Leitner-Ankerl <martin.leitner-ankerl@dynatrace.com>2022-06-07 10:22:45 +0200
committerMartin Leitner-Ankerl <martin.leitner-ankerl@dynatrace.com>2022-06-07 10:22:45 +0200
commit64d72c4c8734b9dd45cb61cb2c2baf98766b0163 (patch)
tree880ce2de78b67c975af8a2bddedcd4fb4f11b280 /test/lint/all-lint.py
parent1b2e1d179c5b350cac69ee670e01355314f25e11 (diff)
downloadbitcoin-64d72c4c8734b9dd45cb61cb2c2baf98766b0163.tar.xz
test: rename lint-all.py to all-lint.py
That way it is impossible for the script to call itself.
Diffstat (limited to 'test/lint/all-lint.py')
-rwxr-xr-xtest/lint/all-lint.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lint/all-lint.py b/test/lint/all-lint.py
new file mode 100755
index 0000000000..c280ba2db2
--- /dev/null
+++ b/test/lint/all-lint.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2017-2022 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#
+# This script runs all test/lint/lint-* files, and fails if any exit
+# with a non-zero status code.
+
+from glob import glob
+from pathlib import Path
+from subprocess import run
+
+exit_code = 0
+mod_path = Path(__file__).parent
+for lint in glob(f"{mod_path}/lint-*"):
+ if lint != __file__:
+ result = run([lint])
+ if result.returncode != 0:
+ print(f"^---- failure generated from {lint.split('/')[-1]}")
+ exit_code |= result.returncode
+
+exit(exit_code)