Skip to content

Commit

Permalink
Ignore pyproject.toml for adding noqa directives (#5013)
Browse files Browse the repository at this point in the history
## Summary

Ignore pyproject.toml file for adding noqa directives using `--add-noqa`

## Test Plan

`cargo run --bin ruff -- check --add-noqa .`

fixes: #5012
  • Loading branch information
dhruvmanila authored Jun 12, 2023
1 parent eac3a0c commit c3d1fa8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/ruff_cli/src/commands/add_noqa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit c3d1fa8

Please sign in to comment.