lint: more reuse of SHARED_EXCLUDED_SUBTREES
What changed, and why it matters
This commit is a minor cleanup of internal linting scripts. It moves one directory path into a shared list so that multiple code-style checkers can reuse it. There is no change to the Bitcoin software that users run, no change to security logic, and no security relevance.
No security action needed. This is a routine code-quality refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch refactors three Python lint scripts under test/lint/. It adds ‘src/crypto/ctaes/’ to the SHARED_EXCLUDED_SUBTREES list in lint_ignore_dirs.py and replaces hard-coded exclusion lists in lint-include-guards.py and lint-locale-dependence.py with references to that shared constant. The set of excluded directories is effectively unchanged (ctaes was already excluded in lint-include-guards.py and is now also excluded via the shared list). This is purely a maintainability refactor of static-analysis tooling.
Changed components
test/lint/lint_ignore_dirs.pytest/lint/lint-include-guards.pytest/lint/lint-locale-dependence.pyInspect captured patch +4 / −7
diff --git a/test/lint/lint-include-guards.py b/test/lint/lint-include-guards.py
index dbbf0325..4518f458 100755
--- a/test/lint/lint-include-guards.py
+++ b/test/lint/lint-include-guards.py
@@ -19,7 +19,6 @@ HEADER_ID_PREFIX = 'BITCOIN_'
HEADER_ID_SUFFIX = '_H'
EXCLUDE_FILES_WITH_PREFIX = ['contrib/devtools/bitcoin-tidy',
- 'src/crypto/ctaes',
'src/tinyformat.h',
'src/bench/nanobench.h',
'src/test/fuzz/FuzzedDataProvider.h'] + SHARED_EXCLUDED_SUBTREES
diff --git a/test/lint/lint-locale-dependence.py b/test/lint/lint-locale-dependence.py
index c6a64587..4957c694 100755
--- a/test/lint/lint-locale-dependence.py
+++ b/test/lint/lint-locale-dependence.py
@@ -40,6 +40,8 @@ import sys
from subprocess import check_output, CalledProcessError
+from lint_ignore_dirs import SHARED_EXCLUDED_SUBTREES
+
KNOWN_VIOLATIONS = [
"src/dbwrapper.cpp:.*vsnprintf",
@@ -50,13 +52,8 @@ KNOWN_VIOLATIONS = [
]
REGEXP_EXTERNAL_DEPENDENCIES_EXCLUSIONS = [
- "src/crypto/ctaes/",
- "src/ipc/libmultiprocess/",
- "src/leveldb/",
- "src/secp256k1/",
- "src/minisketch/",
"src/tinyformat.h",
-]
+] + SHARED_EXCLUDED_SUBTREES
LOCALE_DEPENDENT_FUNCTIONS = [
"alphasort", # LC_COLLATE (via strcoll)
diff --git a/test/lint/lint_ignore_dirs.py b/test/lint/lint_ignore_dirs.py
index 838f01b6..60637832 100644
--- a/test/lint/lint_ignore_dirs.py
+++ b/test/lint/lint_ignore_dirs.py
@@ -9,4 +9,5 @@ SHARED_EXCLUDED_SUBTREES = ["src/leveldb/",
"src/secp256k1/",
"src/minisketch/",
"src/ipc/libmultiprocess/",
+ "src/crypto/ctaes/",
]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.