Skip to content

Commit 29f44fe

Browse files
committed
Converting lint-all.sh to lint-all.py.
Converting `lint-all.sh` to `lint-all.py`.
1 parent 1e7db37 commit 29f44fe

File tree

5 files changed

+26
-33
lines changed

5 files changed

+26
-33
lines changed

ci/lint/06_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test/lint/git-subtree-check.sh src/univalue
2222
test/lint/git-subtree-check.sh src/leveldb
2323
test/lint/git-subtree-check.sh src/crc32c
2424
test/lint/check-doc.py
25-
test/lint/lint-all.sh
25+
test/lint/lint-all.py
2626

2727
if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then
2828
# Sanity check only the last few commits to get notified of missing sigs,

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ test/lint/lint-files.py
327327
You can run all the shell-based lint tests by running:
328328

329329
```
330-
test/lint/lint-all.sh
330+
test/lint/lint-all.py
331331
```
332332

333333
# Writing functional tests

test/lint/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ To do so, add the upstream repository as remote:
3939
git remote add --fetch secp256k1 https://github.com/bitcoin-core/secp256k1.git
4040
```
4141

42-
lint-all.sh
42+
lint-all.py
4343
===========
4444
Calls other scripts with the `lint-` prefix.

test/lint/lint-all.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Copyright (c) 2017-2022 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
#
7+
# This script runs all test/lint/lint-* files, and fails if any exit
8+
# with a non-zero status code.
9+
10+
from glob import glob
11+
from pathlib import Path
12+
from subprocess import run
13+
14+
exit_code = 0
15+
mod_path = Path(__file__).parent
16+
for lint in glob(f"{mod_path}/lint-*"):
17+
if lint != __file__:
18+
result = run([lint])
19+
if result.returncode != 0:
20+
print(f"^---- failure generated from {lint.split('/')[-1]}")
21+
exit_code |= result.returncode
22+
23+
exit(exit_code)

test/lint/lint-all.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)