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:
Charlie Marsh 2023-06-27 12:53:47 -04:00 committed by GitHub
parent 962479d943
commit 032b967b05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
_ => {}
}
}