Skip to content

Commit 28f2ca6

Browse files
committed
Merge bitcoin#29479: test: Refactor subtree exclusion in lint tests
80fa7da test: Refactor subtree exclusion in lint tests (Brandon Odiwuor) Pull request description: Fixes bitcoin#17413 Refactor subtree exclusion in lint tests to one place Second attempt after PR: bitcoin#24435 ACKs for top commit: fjahr: re-ACK 80fa7da maflcko: lgtm ACK 80fa7da davidgumberg: ACK bitcoin@80fa7da Tree-SHA512: deff7457dd19ca5ea440d3d53feae047e8863b9ddeb6494a3c94605a5d16edc91db8f99a435b4fab2ef89aedee42439562be006da647fb85bbf3def903a3ce50
2 parents b8b0d64 + 80fa7da commit 28f2ca6

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

test/lint/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,7 @@ To do so, add the upstream repository as remote:
8787
```
8888
git remote add --fetch secp256k1 https://github.com/bitcoin-core/secp256k1.git
8989
```
90+
91+
lint_ignore_dirs.py
92+
===================
93+
Add list of common directories to ignore when running tests

test/lint/lint-include-guards.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@
1212
import sys
1313
from subprocess import check_output
1414

15+
from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES
16+
1517

1618
HEADER_ID_PREFIX = 'BITCOIN_'
1719
HEADER_ID_SUFFIX = '_H'
1820

1921
EXCLUDE_FILES_WITH_PREFIX = ['contrib/devtools/bitcoin-tidy',
2022
'src/crypto/ctaes',
21-
'src/leveldb',
22-
'src/crc32c',
23-
'src/secp256k1',
24-
'src/minisketch',
2523
'src/tinyformat.h',
2624
'src/bench/nanobench.h',
27-
'src/test/fuzz/FuzzedDataProvider.h']
25+
'src/test/fuzz/FuzzedDataProvider.h'] + SHARED_EXCLUDED_SUBTREES
2826

2927

3028
def _get_header_file_lst() -> list[str]:

test/lint/lint-includes.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414

1515
from subprocess import check_output, CalledProcessError
1616

17+
from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES
18+
1719

1820
EXCLUDED_DIRS = ["contrib/devtools/bitcoin-tidy/",
19-
"src/leveldb/",
20-
"src/crc32c/",
21-
"src/secp256k1/",
22-
"src/minisketch/",
23-
]
21+
] + SHARED_EXCLUDED_SUBTREES
2422

2523
EXPECTED_BOOST_INCLUDES = ["boost/date_time/posix_time/posix_time.hpp",
2624
"boost/multi_index/detail/hash_index_iterator.hpp",

test/lint/lint-spelling.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111

1212
from subprocess import check_output, STDOUT, CalledProcessError
1313

14+
from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES
15+
1416
IGNORE_WORDS_FILE = 'test/lint/spelling.ignore-words.txt'
15-
FILES_ARGS = ['git', 'ls-files', '--', ":(exclude)build-aux/m4/", ":(exclude)contrib/seeds/*.txt", ":(exclude)depends/", ":(exclude)doc/release-notes/", ":(exclude)src/leveldb/", ":(exclude)src/crc32c/", ":(exclude)src/qt/locale/", ":(exclude)src/qt/*.qrc", ":(exclude)src/secp256k1/", ":(exclude)src/minisketch/", ":(exclude)contrib/guix/patches"]
17+
FILES_ARGS = ['git', 'ls-files', '--', ":(exclude)build-aux/m4/", ":(exclude)contrib/seeds/*.txt", ":(exclude)depends/", ":(exclude)doc/release-notes/", ":(exclude)src/qt/locale/", ":(exclude)src/qt/*.qrc", ":(exclude)contrib/guix/patches"]
18+
FILES_ARGS += [f":(exclude){dir}" for dir in SHARED_EXCLUDED_SUBTREES]
1619

1720

1821
def check_codespell_install():

test/lint/lint_ignore_dirs.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SHARED_EXCLUDED_SUBTREES = ["src/leveldb/",
2+
"src/crc32c/",
3+
"src/secp256k1/",
4+
"src/minisketch/",
5+
]

0 commit comments

Comments
 (0)