mirror of https://github.com/astral-sh/ruff
Use `relativize_path` for `noqa` warnings (#5867)
Refs https://github.com/astral-sh/ruff/pull/5856
This commit is contained in:
parent
68097e34e6
commit
cdfed3d50e
|
|
@ -236,7 +236,7 @@ impl FileExemption {
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
let line = locator.compute_line_index(range.start());
|
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}");
|
warn!("Invalid `# noqa` directive on {path_display}:{line}: {err}");
|
||||||
}
|
}
|
||||||
Ok(Some(ParsedFileExemption::All)) => {
|
Ok(Some(ParsedFileExemption::All)) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue