How about this to at least filter out the easy commented lines?
diff --git a/test/lint/test_runner/src/main.rs b/test/lint/test_runner/src/main.rs
index d9950c3fba..fa5ac0a597 100644
--- a/test/lint/test_runner/src/main.rs
+++ b/test/lint/test_runner/src/main.rs
@@ -106,10 +106,16 @@ fn lint_includes_build_config() -> LintResult {
- let defines_regex = check_output(Command::new("grep").args(["undef ", "--", config_path]))
- .expect("grep failed")
- .lines()
- .map(|line| {
- line.split("undef ")
- .nth(1)
- .expect(&format!("Could not extract name in line: {line}"))
- })
- .collect::<Vec<_>>()
- .join("|");
+ let defines_regex = format!(
+ "^(?!//).*({})",
+ check_output(Command::new("grep").args(["undef ", "--", config_path]))
+ .expect("grep failed")
+ .lines()
+ .map(|line| {
+ line.split("undef ")
+ .nth(1)
+ .expect(&format!("Could not extract name in line: {line}"))
+ })
+ .collect::<Vec<_>>()
+ .join("|")
+ );
+
+ println!("{}", defines_regex);
+
@@ -120 +126 @@ fn lint_includes_build_config() -> LintResult {
- "--extended-regexp",
+ "--perl-regexp",