From 6dc7a11b2cceee59066b18985d53642b4a0b014a Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Thu, 13 Jul 2023 12:54:05 +0530 Subject: [PATCH] Ignore Jupyter Notebooks for `--add-noqa` --- crates/ruff_cli/src/commands/add_noqa.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_cli/src/commands/add_noqa.rs b/crates/ruff_cli/src/commands/add_noqa.rs index 0ee7027f9799e..06cc9b13f16cf 100644 --- a/crates/ruff_cli/src/commands/add_noqa.rs +++ b/crates/ruff_cli/src/commands/add_noqa.rs @@ -9,7 +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 ruff_python_stdlib::path::{is_jupyter_notebook, is_project_toml}; use crate::args::Overrides; @@ -47,7 +47,7 @@ pub(crate) fn add_noqa( .flatten() .filter_map(|entry| { let path = entry.path(); - if is_project_toml(path) { + if is_project_toml(path) || is_jupyter_notebook(path) { return None; } let package = path