Skip to content

Commit 85aea18

Browse files
committed
Merge bitcoin/bitcoin#24982: tests: Port lint-all.sh to lint-all.py
29f44fe Converting `lint-all.sh` to `lint-all.py`. (hiago) Pull request description: This PR is converting `test/lint/lint-all.sh` to `test/lint/lint-assertions.py`. It's an item of bitcoin/bitcoin#24783. ACKs for top commit: laanwj: Tested ACK 29f44fe Tree-SHA512: 5427936aaa8e009613048448cbd79d9225675bdcadcf4fbb70fd091e0aab85e350ef1678da1b388f70d62ca16f40409409f90da3f6bbf057480522cd50fde811
2 parents b51e60f + 29f44fe commit 85aea18

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)