lint: Add archived notes to default excludes

No need to touch or lint them.
This commit is contained in:
MarcoFalke
2025-05-13 12:18:34 +02:00
parent 59e09e0fb7
commit fa2b2aa27c

View File

@ -209,10 +209,13 @@ fn get_subtrees() -> Vec<&'static str> {
]
}
/// Return the pathspecs to exclude all subtrees
fn get_pathspecs_exclude_subtrees() -> Vec<String> {
/// Return the pathspecs to exclude by default
fn get_pathspecs_default_excludes() -> Vec<String> {
get_subtrees()
.iter()
.chain(&[
"doc/release-notes/release-notes-*", // archived notes
])
.map(|s| format!(":(exclude){}", s))
.collect()
}
@ -333,7 +336,7 @@ fn lint_py_lint() -> LintResult {
let files = check_output(
git()
.args(["ls-files", "--", "*.py"])
.args(get_pathspecs_exclude_subtrees()),
.args(get_pathspecs_default_excludes()),
)?;
let mut cmd = Command::new(bin_name);
@ -459,7 +462,7 @@ expected to follow the naming "/doc/release-notes-<PR number>.md".
/// Return the pathspecs for whitespace related excludes
fn get_pathspecs_exclude_whitespace() -> Vec<String> {
let mut list = get_pathspecs_exclude_subtrees();
let mut list = get_pathspecs_default_excludes();
list.extend(
[
// Permanent excludes
@ -468,7 +471,6 @@ fn get_pathspecs_exclude_whitespace() -> Vec<String> {
"contrib/windeploy/win-codesign.cert",
"doc/README_windows.txt",
// Temporary excludes, or existing violations
"doc/release-notes/release-notes-0.*",
"contrib/init/bitcoind.openrc",
"contrib/macdeploy/macdeployqtplus",
"src/crypto/sha256_sse4.cpp",
@ -569,7 +571,7 @@ fn lint_includes_build_config() -> LintResult {
"*.cpp",
"*.h",
])
.args(get_pathspecs_exclude_subtrees())
.args(get_pathspecs_default_excludes())
.args([
// These are exceptions which don't use bitcoin-build-config.h, rather CMakeLists.txt adds
// these cppflags manually.