Skip to content

Commit f78389c

Browse files
committed
check trigger_files too
1 parent 4f51e6b commit f78389c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/tools/tidy/src/triagebot.rs

+29
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,33 @@ pub fn check(path: &Path, bad: &mut bool) {
5151
}
5252
}
5353
}
54+
55+
// Verify that trigger_files in [autolabel."*"] exist in the project, i.e.
56+
// [autolabel."A-rustdoc-search"]
57+
// trigger_files = [
58+
// "src/librustdoc/html/static/js/search.js",
59+
// "tests/rustdoc-js",
60+
// "tests/rustdoc-js-std",
61+
// ]
62+
if let Some(Value::Table(autolabels)) = config.get("autolabel") {
63+
for (label, content) in autolabels {
64+
if let Some(trigger_files) = content.get("trigger_files").and_then(|v| v.as_array()) {
65+
for file in trigger_files {
66+
if let Some(file_str) = file.as_str() {
67+
let full_path = path.join(file_str);
68+
69+
// Handle both file and directory paths
70+
if !full_path.exists() {
71+
tidy_error!(
72+
bad,
73+
"triagebot.toml [autolabel.{}] contains trigger_files path '{}' which doesn't exist",
74+
label,
75+
file_str
76+
);
77+
}
78+
}
79+
}
80+
}
81+
}
82+
}
5483
}

0 commit comments

Comments
 (0)