From 032b967b055f7fc5dde11b09e9b6c31ef3bb4bbc Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 27 Jun 2023 12:53:47 -0400 Subject: [PATCH] Enable --watch for Jupyter notebooks (#5394) ## Summary The list of extensions that support watching is hard-coded (unfortunately); this PR adds `.ipynb` to the list. --- crates/ruff_cli/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_cli/src/lib.rs b/crates/ruff_cli/src/lib.rs index 0f737628d1..b7abecc4a1 100644 --- a/crates/ruff_cli/src/lib.rs +++ b/crates/ruff_cli/src/lib.rs @@ -58,7 +58,7 @@ enum ChangeKind { /// Returns `None` if no relevant changes were detected. fn change_detected(paths: &[PathBuf]) -> Option { // If any `.toml` files were modified, return `ChangeKind::Configuration`. Otherwise, return - // `ChangeKind::SourceFile` if any `.py`, `.pyi`, or `.pyw` files were modified. + // `ChangeKind::SourceFile` if any `.py`, `.pyi`, `.pyw`, or `.ipynb` files were modified. let mut source_file = false; for path in paths { if let Some(suffix) = path.extension() { @@ -66,7 +66,7 @@ fn change_detected(paths: &[PathBuf]) -> Option { Some("toml") => { return Some(ChangeKind::Configuration); } - Some("py" | "pyi" | "pyw") => source_file = true, + Some("py" | "pyi" | "pyw" | "ipynb") => source_file = true, _ => {} } }