diff --git a/test/lint/lint-ignore-dirs.txt b/test/lint/lint-ignore-dirs.txt new file mode 100644 index 00000000000000..9cb980bb22bcd0 --- /dev/null +++ b/test/lint/lint-ignore-dirs.txt @@ -0,0 +1,4 @@ +leveldb +crc32c +secp256k1 +minisketch \ No newline at end of file diff --git a/test/lint/lint-include-guards.py b/test/lint/lint-include-guards.py index 291e528c1dbb50..30ba27296f9da1 100755 --- a/test/lint/lint-include-guards.py +++ b/test/lint/lint-include-guards.py @@ -18,14 +18,13 @@ 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'] +with open('test/lint/lint-ignore-dirs.txt', 'r') as file: + EXCLUDE_FILES_WITH_PREFIX += [f"src/{line.strip()}/" for line in file.read()] + def _get_header_file_lst() -> list[str]: """ Helper function to get a list of header filepaths to be diff --git a/test/lint/lint-includes.py b/test/lint/lint-includes.py index 6386a92c0f0e49..8e059ac4b490cd 100755 --- a/test/lint/lint-includes.py +++ b/test/lint/lint-includes.py @@ -14,13 +14,9 @@ from subprocess import check_output, CalledProcessError - -EXCLUDED_DIRS = ["contrib/devtools/bitcoin-tidy/", - "src/leveldb/", - "src/crc32c/", - "src/secp256k1/", - "src/minisketch/", - ] +EXCLUDED_DIRS = ["contrib/devtools/bitcoin-tidy/"] +with open('test/lint/lint-ignore-dirs.txt', 'r') as file: + EXCLUDED_DIRS += [f"src/{line.strip()}/" for line in file.read()] EXPECTED_BOOST_INCLUDES = ["boost/date_time/posix_time/posix_time.hpp", "boost/multi_index/detail/hash_index_iterator.hpp", diff --git a/test/lint/lint-python-utf8-encoding.py b/test/lint/lint-python-utf8-encoding.py index 8c9266470f17eb..268f9eb845c544 100755 --- a/test/lint/lint-python-utf8-encoding.py +++ b/test/lint/lint-python-utf8-encoding.py @@ -12,8 +12,8 @@ from subprocess import check_output, CalledProcessError -EXCLUDED_DIRS = ["src/crc32c/", "src/secp256k1/"] - +with open('test/lint/lint-ignore-dirs.txt', 'r') as file: + EXCLUDED_DIRS = [f"src/{line.strip()}/" for line in file.read()] def get_exclude_args(): return [":(exclude)" + dir for dir in EXCLUDED_DIRS] diff --git a/test/lint/lint-spelling.py b/test/lint/lint-spelling.py index ac0bddeaa6fe4f..bb0f95063645a7 100755 --- a/test/lint/lint-spelling.py +++ b/test/lint/lint-spelling.py @@ -11,8 +11,11 @@ from subprocess import check_output, STDOUT, CalledProcessError +with open('test/lint/lint-ignore-dirs.txt', 'r') as file: + EXCLUDE_FILES = [f":(exclude)src/{line.strip()}/" for line in file.read()] + 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"] + EXCLUDE_FILES def check_codespell_install(): diff --git a/test/lint/lint-whitespace.py b/test/lint/lint-whitespace.py index f5e4a776d0ab59..63ac8d46fe8d17 100755 --- a/test/lint/lint-whitespace.py +++ b/test/lint/lint-whitespace.py @@ -18,13 +18,12 @@ EXCLUDED_DIRS = ["depends/patches/", "contrib/guix/patches/", - "src/leveldb/", - "src/crc32c/", - "src/secp256k1/", - "src/minisketch/", "doc/release-notes/", "src/qt/locale"] +with open('test/lint/lint-ignore-dirs.txt', 'r') as file: + EXCLUDED_DIRS += [f"src/{line.strip()}/" for line in file.read()] + def parse_args(): """Parse command line arguments.""" parser = argparse.ArgumentParser(