ruff/crates
Dhruv Manilawala 2aecaf5060
Consider Jupyter index for code frames (--show-source) (#5402)
## Summary

Consider Jupyter index for code frames (`--show-source`).

This solves two problems as mentioned in the linked issue:

> Omit any contents from adjoining cells

If the Jupyter index is present, we'll use that to check if the
surrounding
lines belong to the same cell as the content line. If not, we'll skip
that line
until we either reach the one which does or we reach the content line.

> code frame line number

If the Jupyter index is present, we'll use that to get the actual start
line in
corresponding to the computed start index.

## Test Plan

`cargo run --bin ruff -- check --no-cache --isolated --select=ALL --show-source /path/to/notebook.ipynb`

fixes: #5395
2023-06-28 08:54:51 +05:30
..
flake8_to_ruff Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00
ruff Consider Jupyter index for code frames (--show-source) (#5402) 2023-06-28 08:54:51 +05:30
ruff_benchmark Create PyFormatOptions 2023-06-26 14:02:17 +02:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Enable --watch for Jupyter notebooks (#5394) 2023-06-27 12:53:47 -04:00
ruff_dev Fix ruff_dev repeat by removing short argument (#5388) 2023-06-27 13:29:20 +00:00
ruff_diagnostics Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_formatter Add tests for skip magic trailing comma 2023-06-26 14:15:55 +02:00
ruff_index Run rustfmt on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
ruff_macros Avoid including nursery rules in linter-level selectors (#5268) 2023-06-21 20:11:40 +00:00
ruff_python_ast Remove prelude from ruff_python_ast (#5369) 2023-06-26 11:43:49 -04:00
ruff_python_formatter Format call expressions (without call chaining) (#5341) 2023-06-27 09:29:40 +00:00
ruff_python_resolver Misc. clean-up for import resolver (#5401) 2023-06-27 19:27:12 +00:00
ruff_python_semantic Respect abc decorators when classifying function types (#5315) 2023-06-22 19:52:36 +00:00
ruff_python_stdlib Experimental release for Jupyter notebook integration (#5363) 2023-06-26 21:22:42 +05:30
ruff_python_whitespace Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_rustpython Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_textwrap Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_wasm Fix autofix capabilities in playground (#5375) 2023-06-26 16:40:28 +00:00