Skip to content

Commit

Permalink
Remove jupyter_notebook features
Browse files Browse the repository at this point in the history
## Summary

Remove the `jupyter_notebook` feature. This is now handled by the `include` feature introduced in #3914

## Test Plan

I have confirmed that running `cargo run --bin ruff -- check --select F841 --no-cache dir_with_notebook/` doesn't pick them up, but adding `include = ["*.ipynb"]` in `pyproject.toml` makes the notebooks found.
  • Loading branch information
konstin committed Jun 15, 2023
1 parent 097823b commit e92b707
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
5 changes: 0 additions & 5 deletions crates/ruff/src/jupyter/notebook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ pub fn round_trip(path: &Path) -> anyhow::Result<String> {
pub fn is_jupyter_notebook(path: &Path) -> bool {
path.extension()
.map_or(false, |ext| ext == JUPYTER_NOTEBOOK_EXT)
// For now this is feature gated here, the long term solution depends on
// https://github.com/astral-sh/ruff/issues/3410
&& cfg!(feature = "jupyter_notebook")
}

impl Cell {
Expand Down Expand Up @@ -410,7 +407,6 @@ mod test {
use test_case::test_case;

use crate::jupyter::index::JupyterIndex;
#[cfg(feature = "jupyter_notebook")]
use crate::jupyter::is_jupyter_notebook;
use crate::jupyter::schema::Cell;
use crate::jupyter::Notebook;
Expand Down Expand Up @@ -473,7 +469,6 @@ mod test {
}

#[test]
#[cfg(feature = "jupyter_notebook")]
fn inclusions() {
let path = Path::new("foo/bar/baz");
assert!(!is_jupyter_notebook(path));
Expand Down
3 changes: 0 additions & 3 deletions crates/ruff_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ wild = { version = "2" }
assert_cmd = { version = "2.0.8" }
ureq = { version = "2.6.2", features = [] }

[features]
jupyter_notebook = ["ruff/jupyter_notebook"]

[target.'cfg(target_os = "windows")'.dependencies]
mimalloc = "0.1.34"

Expand Down
1 change: 0 additions & 1 deletion crates/ruff_cli/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ with the relevant file contents, the `pyproject.toml` settings, and the followin
}

#[cfg(test)]
#[cfg(feature = "jupyter_notebook")]
mod test {
use std::path::PathBuf;
use std::str::FromStr;
Expand Down

0 comments on commit e92b707

Please sign in to comment.