Add comment for include!() usage

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-03-22 19:03:29 +00:00
parent f85063c1a8
commit ec25a425aa
No known key found for this signature in database
GPG Key ID: 95DDEBD74A1DC2C0

View File

@ -9,6 +9,9 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
let tests_path = &root_path.join("tests"); let tests_path = &root_path.join("tests");
let allowed_makefiles = { let allowed_makefiles = {
// We use `include!` here which includes the file as Rust syntax because we want to have
// a comment that discourages people from adding entries to
// `expected_run_make_makefiles.txt` unless *absolutely* necessary.
let allowed_makefiles = include!("expected_run_make_makefiles.txt"); let allowed_makefiles = include!("expected_run_make_makefiles.txt");
let is_sorted = allowed_makefiles.windows(2).all(|w| w[0] < w[1]); let is_sorted = allowed_makefiles.windows(2).all(|w| w[0] < w[1]);
if !is_sorted && !bless { if !is_sorted && !bless {