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();