From fdef71db56da506c4595251a86f748d4e6a93c7a Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 18 Jul 2023 19:28:29 +0300 Subject: [PATCH] Use `relativize_path` for `noqa` warnings Refs https://github.com/astral-sh/ruff/pull/5856 --- crates/ruff/src/noqa.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff/src/noqa.rs b/crates/ruff/src/noqa.rs index 63b48c3e23fc7..a8f24d635514d 100644 --- a/crates/ruff/src/noqa.rs +++ b/crates/ruff/src/noqa.rs @@ -236,7 +236,7 @@ impl FileExemption { Err(err) => { #[allow(deprecated)] let line = locator.compute_line_index(range.start()); - let path_display = path.display(); + let path_display = relativize_path(path.display()); warn!("Invalid `# noqa` directive on {path_display}:{line}: {err}"); } Ok(Some(ParsedFileExemption::All)) => {