mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-13 13:57:22 +00:00
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.
This commit is contained in:
parent
962479d943
commit
032b967b05
1 changed files with 2 additions and 2 deletions
|
@ -58,7 +58,7 @@ enum ChangeKind {
|
|||
/// Returns `None` if no relevant changes were detected.
|
||||
fn change_detected(paths: &[PathBuf]) -> Option<ChangeKind> {
|
||||
// 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<ChangeKind> {
|
|||
Some("toml") => {
|
||||
return Some(ChangeKind::Configuration);
|
||||
}
|
||||
Some("py" | "pyi" | "pyw") => source_file = true,
|
||||
Some("py" | "pyi" | "pyw" | "ipynb") => source_file = true,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue