Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Refactor subtree exclusion in lint tests #29479

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/lint/README.md
Expand Up @@ -87,3 +87,7 @@ To do so, add the upstream repository as remote:
```
git remote add --fetch secp256k1 https://github.com/bitcoin-core/secp256k1.git
```

lint_ignore_dirs.py
===================
Add list of common directories to ignore when running tests
8 changes: 3 additions & 5 deletions test/lint/lint-include-guards.py
Expand Up @@ -12,19 +12,17 @@
import sys
from subprocess import check_output

from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES


HEADER_ID_PREFIX = 'BITCOIN_'
HEADER_ID_SUFFIX = '_H'

EXCLUDE_FILES_WITH_PREFIX = ['contrib/devtools/bitcoin-tidy',
'src/crypto/ctaes',
'src/leveldb',
'src/crc32c',
'src/secp256k1',
'src/minisketch',
'src/tinyformat.h',
'src/bench/nanobench.h',
'src/test/fuzz/FuzzedDataProvider.h']
'src/test/fuzz/FuzzedDataProvider.h'] + SHARED_EXCLUDED_SUBTREES


def _get_header_file_lst() -> list[str]:
Expand Down
8 changes: 3 additions & 5 deletions test/lint/lint-includes.py
Expand Up @@ -14,13 +14,11 @@

from subprocess import check_output, CalledProcessError

from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES


EXCLUDED_DIRS = ["contrib/devtools/bitcoin-tidy/",
"src/leveldb/",
"src/crc32c/",
"src/secp256k1/",
"src/minisketch/",
]
] + SHARED_EXCLUDED_SUBTREES

EXPECTED_BOOST_INCLUDES = ["boost/date_time/posix_time/posix_time.hpp",
"boost/multi_index/detail/hash_index_iterator.hpp",
Expand Down
5 changes: 4 additions & 1 deletion test/lint/lint-spelling.py
Expand Up @@ -11,8 +11,11 @@

from subprocess import check_output, STDOUT, CalledProcessError

from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES

IGNORE_WORDS_FILE = 'test/lint/spelling.ignore-words.txt'
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"]
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"]
FILES_ARGS += [f":(exclude){dir}" for dir in SHARED_EXCLUDED_SUBTREES]


def check_codespell_install():
Expand Down
5 changes: 5 additions & 0 deletions test/lint/lint_ignore_dirs.py
@@ -0,0 +1,5 @@
SHARED_EXCLUDED_SUBTREES = ["src/leveldb/",
"src/crc32c/",
"src/secp256k1/",
"src/minisketch/",
]