ruff/crates
Dhruv Manilawala 48f4f2d63d
Maintain consistency when deserializing to JSON (#5114)
## Summary

Maintain consistency while deserializing Jupyter notebook to JSON. The
following changes were made:

1. Use string array to store the source value as that's the default
(5781720423/nbformat/v4/nbjson.py (L56-L57))
2. Remove unused structs and enums
3. Reorder the keys in alphabetical order as that's the default.
(5781720423/nbformat/v4/nbjson.py (L51))

### Side effect

Removing the `preserve_order` feature means that the order of keys in
JSON output (`--format json`) will be in alphabetical order. This is
because the value is represented using `serde_json::Value` which
internally is a `BTreeMap`, thus sorting it as per the string key. For
posterity if this turns out to be not ideal, then we could define a
struct representing the JSON object and the order of struct fields will
determine the order in the JSON string.

## Test Plan

Add a test case to assert the raw JSON string.
2023-06-19 23:47:56 +05:30
..
flake8_to_ruff Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff Maintain consistency when deserializing to JSON (#5114) 2023-06-19 23:47:56 +05:30
ruff_benchmark Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Maintain consistency when deserializing to JSON (#5114) 2023-06-19 23:47:56 +05:30
ruff_dev Add a script that tests formatter stability on repositories (#5055) 2023-06-19 14:13:38 +00:00
ruff_diagnostics Use consistent Cargo.toml metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_formatter Run rustfmt on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
ruff_index Run rustfmt on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
ruff_macros Refactor top llvm-lines entry (#5147) 2023-06-18 12:39:06 +02:00
ruff_python_ast Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_python_formatter Explain dangling comments in the formatter (#5170) 2023-06-19 14:24:45 +02:00
ruff_python_semantic Rename *Importation structs to *Import (#5185) 2023-06-19 12:09:10 -04:00
ruff_python_stdlib Replace static CallPath vectors with matches! macros (#5148) 2023-06-16 17:34:42 +00:00
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_testing_macros 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 Add support for auto-fix in Jupyter notebooks (#4665) 2023-06-12 14:14:15 +00:00