From 64d72c4c8734b9dd45cb61cb2c2baf98766b0163 Mon Sep 17 00:00:00 2001 From: Martin Leitner-Ankerl Date: Tue, 7 Jun 2022 10:22:45 +0200 Subject: [PATCH 1/2] test: rename lint-all.py to all-lint.py That way it is impossible for the script to call itself. --- ci/lint/06_script.sh | 2 +- test/README.md | 2 +- test/lint/README.md | 2 +- test/lint/{lint-all.py => all-lint.py} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename test/lint/{lint-all.py => all-lint.py} (100%) diff --git a/ci/lint/06_script.sh b/ci/lint/06_script.sh index f174b4d074..84b3404e78 100755 --- a/ci/lint/06_script.sh +++ b/ci/lint/06_script.sh @@ -22,7 +22,7 @@ test/lint/git-subtree-check.sh src/univalue test/lint/git-subtree-check.sh src/leveldb test/lint/git-subtree-check.sh src/crc32c test/lint/check-doc.py -test/lint/lint-all.py +test/lint/all-lint.py if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then # Sanity check only the last few commits to get notified of missing sigs, diff --git a/test/README.md b/test/README.md index 0d9b9fb89b..6ca7cc0016 100644 --- a/test/README.md +++ b/test/README.md @@ -327,7 +327,7 @@ test/lint/lint-files.py You can run all the shell-based lint tests by running: ``` -test/lint/lint-all.py +test/lint/all-lint.py ``` # Writing functional tests diff --git a/test/lint/README.md b/test/lint/README.md index 1f683c10b3..a23211a72b 100644 --- a/test/lint/README.md +++ b/test/lint/README.md @@ -39,6 +39,6 @@ To do so, add the upstream repository as remote: git remote add --fetch secp256k1 https://github.com/bitcoin-core/secp256k1.git ``` -lint-all.py +all-lint.py =========== Calls other scripts with the `lint-` prefix. diff --git a/test/lint/lint-all.py b/test/lint/all-lint.py similarity index 100% rename from test/lint/lint-all.py rename to test/lint/all-lint.py From f26a496dfd0a7ce3833a10075027d7d5b0345e32 Mon Sep 17 00:00:00 2001 From: Martin Leitner-Ankerl Date: Tue, 7 Jun 2022 10:24:55 +0200 Subject: [PATCH 2/2] test: clean up all-lint.py Removed th check against __file__ which is not necessary any more after the rename to all-lint.py. Changed glob to find only `lint-*.py` scripts. --- test/lint/all-lint.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/lint/all-lint.py b/test/lint/all-lint.py index c280ba2db2..34a7b9742a 100755 --- a/test/lint/all-lint.py +++ b/test/lint/all-lint.py @@ -13,11 +13,10 @@ 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 +for lint in glob(f"{mod_path}/lint-*.py"): + result = run([lint]) + if result.returncode != 0: + print(f"^---- failure generated from {lint.split('/')[-1]}") + exit_code |= result.returncode exit(exit_code)