ruff/crates/ruff_notebook
Charlie Marsh f64c389654
Detect and ignore Jupyter automagics (#8398)
## Summary

LangChain is attempting to use Ruff over their Jupyter notebooks
(https://github.com/langchain-ai/langchain/pull/12677/files), but
running into a bunch of syntax errors, the majority of which come from
our inability to recognize automagic.

If you run this in a cell:

```jupyter
pip install requests
```

Jupyter will automatically treat that as:

```jupyter
%pip install requests
```

We need to ignore cells that use these automagics, since the parser
doesn't understand them. (I guess we could support it in the parser, but
that seems much harder?). The good news is that AFAICT Jupyter doesn't
let you mix automagics with code, so by skipping these cells, we don't
miss out on analyzing any Python code.

## Test Plan

1. `cargo test`
2. Ran over LangChain and verified that there are no more errors
relating to `pip install` automagics.
2023-11-03 01:14:10 +00:00
..
resources/test/fixtures/jupyter Detect and ignore Jupyter automagics (#8398) 2023-11-03 01:14:10 +00:00
src Detect and ignore Jupyter automagics (#8398) 2023-11-03 01:14:10 +00:00
Cargo.toml Bump serde_with from 3.3.0 to 3.4.0 (#8130) 2023-10-23 09:05:52 +00:00