mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Ignore pyproject.toml for adding noqa directives (#5013)
## Summary Ignore pyproject.toml file for adding noqa directives using `--add-noqa` ## Test Plan `cargo run --bin ruff -- check --add-noqa .` fixes: #5012
This commit is contained in:
parent
eac3a0cc3d
commit
c3d1fa851e
1 changed files with 4 additions and 0 deletions
|
@ -9,6 +9,7 @@ use rayon::prelude::*;
|
|||
use ruff::linter::add_noqa_to_path;
|
||||
use ruff::resolver::PyprojectConfig;
|
||||
use ruff::{packaging, resolver, warn_user_once};
|
||||
use ruff_python_stdlib::path::is_project_toml;
|
||||
|
||||
use crate::args::Overrides;
|
||||
|
||||
|
@ -46,6 +47,9 @@ pub(crate) fn add_noqa(
|
|||
.flatten()
|
||||
.filter_map(|entry| {
|
||||
let path = entry.path();
|
||||
if is_project_toml(path) {
|
||||
return None;
|
||||
}
|
||||
let package = path
|
||||
.parent()
|
||||
.and_then(|parent| package_roots.get(parent))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue