From cdfed3d50eeef6b5614906ad56bbad4012b2ac6e Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 18 Jul 2023 19:44:32 +0300 Subject: [PATCH] Use `relativize_path` for `noqa` warnings (#5867) 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 63b48c3e23..3fa57d43b6 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); warn!("Invalid `# noqa` directive on {path_display}:{line}: {err}"); } Ok(Some(ParsedFileExemption::All)) => {