Use relativize_path for noqa warnings (#5867)

Refs https://github.com/astral-sh/ruff/pull/5856
This commit is contained in:
Nikita Sobolev
2023-07-18 19:44:32 +03:00
committed by GitHub
parent 68097e34e6
commit cdfed3d50e

View File

@@ -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)) => {