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