ruff/crates
Dhruv Manilawala ff53db3d99
Consider VS Code cell metadata to determine valid code cells (#12864)
## Summary

This PR adds support for VS Code specific cell metadata to consider when
collecting valid code cells.

For context, Ruff only runs on valid code cells. These are the code
cells that doesn't contain cell magics. Previously, Ruff only used the
notebook's metadata to determine whether it's a Python notebook. But, in
VS Code, a notebook's preferred language might be Python but it could
still contain code cells for other languages. This can be determined
with the `metadata.vscode.languageId` field.

### References:
* https://code.visualstudio.com/docs/languages/identifiers
* e6c009a3d4/extensions/ipynb/src/serializers.ts (L104-L107)
*
e6c009a3d4/extensions/ipynb/src/serializers.ts (L117-L122)

This brings us one step closer to fixing #12281.

## Test Plan

Add test cases for `is_valid_python_code_cell` and an integration test
case which showcase running it end to end. The test notebook contains a
JavaScript code cell and a Python code cell.
2024-08-13 22:09:56 +05:30
..
red_knot Eagerly validate search paths (#12783) 2024-08-12 07:46:59 +00:00
red_knot_python_semantic Add scope and definitions for comprehensions (#12748) 2024-08-13 07:00:33 +05:30
red_knot_server Consider VS Code cell metadata to determine valid code cells (#12864) 2024-08-13 22:09:56 +05:30
red_knot_wasm [red-knot] Add filename and source location for diagnostics (#12842) 2024-08-12 15:56:30 +00:00
red_knot_workspace [red-knot] Use Windows specific path separator in tests (#12847) 2024-08-12 22:26:59 +05:30
ruff Bump version to 0.5.7 (#12756) 2024-08-08 20:56:15 +05:30
ruff_benchmark Add scope and definitions for comprehensions (#12748) 2024-08-13 07:00:33 +05:30
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db Skip checking a file if it failed to read (#12755) 2024-08-12 07:26:37 +00:00
ruff_dev Drop deprecated nursery rule group (#10172) 2024-06-27 13:44:11 +02:00
ruff_diagnostics [Minor typo] Fix article in "an fix" (#12797) 2024-08-10 21:22:00 -04:00
ruff_formatter Upgrade to Rust 1.80 (#12586) 2024-07-30 19:18:08 +00:00
ruff_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ruff_linter Consider VS Code cell metadata to determine valid code cells (#12864) 2024-08-13 22:09:56 +05:30
ruff_macros Drop deprecated nursery rule group (#10172) 2024-06-27 13:44:11 +02:00
ruff_notebook Consider VS Code cell metadata to determine valid code cells (#12864) 2024-08-13 22:09:56 +05:30
ruff_python_ast Implement iter(), len() and is_empty() for all display-literal AST nodes (#12807) 2024-08-12 10:39:28 +00:00
ruff_python_ast_integration_tests Rename PreorderVisitor to SourceOrderVisitor (#11798) 2024-06-07 17:01:58 +00:00
ruff_python_codegen Implement iter(), len() and is_empty() for all display-literal AST nodes (#12807) 2024-08-12 10:39:28 +00:00
ruff_python_formatter Implement iter(), len() and is_empty() for all display-literal AST nodes (#12807) 2024-08-12 10:39:28 +00:00
ruff_python_index Enable token-based rules on source with syntax errors (#11950) 2024-07-02 08:57:46 +00:00
ruff_python_literal Remove some unused pub functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_python_parser Upgrade to Rust 1.80 (#12586) 2024-07-30 19:18:08 +00:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Implement iter(), len() and is_empty() for all display-literal AST nodes (#12807) 2024-08-12 10:39:28 +00:00
ruff_python_stdlib Add a new script to generate builtin module names (#12696) 2024-08-05 21:33:36 +01:00
ruff_python_trivia Mention that Cursor is based on rustc's implementation. (#12109) 2024-06-30 16:53:25 +01:00
ruff_python_trivia_integration_tests Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_server Consider VS Code cell metadata to determine valid code cells (#12864) 2024-08-13 22:09:56 +05:30
ruff_source_file red-knot: source_text, line_index, and parsed_module queries (#11822) 2024-06-13 07:37:02 +00:00
ruff_text_size Upgrade to Rust 1.79 (#11875) 2024-06-17 07:15:10 +01:00
ruff_wasm Bump version to 0.5.7 (#12756) 2024-08-08 20:56:15 +05:30
ruff_workspace Fix cache invalidation for nested pyproject.toml files (#12727) 2024-08-07 21:53:45 +02:00