From e5130b66209ad9d34c492e66881fb1afa87b1bda Mon Sep 17 00:00:00 2001 From: Abhinav Srivastav Date: Wed, 21 Oct 2026 16:51:45 +0530 Subject: [PATCH] tidy: use repository-relative path for style checks --- src/tools/tidy/src/style.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 5d57211b914d7..49cc6675e5e2d 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -326,8 +326,8 @@ static PROBLEMATIC_REGEX: LazyLock = LazyLock::new(|| { fn check_file_style(base_path: &Path, check: &mut RunningCheck, file: &Path, contents: &str) { // In some cases, a style check would be triggered by its own implementation - // or comments. A simple workaround is to just allowlist this file. - let this_file = Path::new(file!()); + // or comments. Use a repository-relative path because file!() may be remapped. + let this_file = Path::new("src/tools/tidy/src/style.rs"); let codegen_file = Path::new("src/tools/tidy/src/codegen.rs"); let path_str = file.to_string_lossy();