ruff/crates
Zanie Blue aaa00976ae
Generate deterministic ids when formatting notebooks (#9359)
When formatting notebooks, we populate the `id` field for cells that do
not have one. Previously, we generated a UUID v4 which resulted in
non-deterministic formatting. Here, we generate the UUID from a seeded
random number generator instead of using true randomness. For example,
here are the first five ids it would generate:

```
7fb27b94-1602-401d-9154-2211134fc71a
acae54e3-7e7d-407b-bb7b-55eff062a284
9a63283c-baf0-4dbc-ab1f-6479b197f3a8
8dd0d809-2fe7-4a7c-9628-1538738b07e2
72eea511-9410-473a-a328-ad9291626812
```

We also add a check that an id is not present in another cell to prevent
accidental introduction of duplicate ids.

The specification is lax, and we could just use incrementing integers
e.g. `0`, `1`, ... but I have a minor preference for retaining the UUID
format. Some discussion
[here](https://github.com/astral-sh/ruff/pull/9359#discussion_r1439607121)
— I'm happy to go either way though.

Discovered via #9293
2024-01-04 09:19:00 -06:00
..
ruff_benchmark Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_cache Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_cli Bump version to 0.1.11 (#9370) 2024-01-02 17:46:06 -05:00
ruff_dev Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_diagnostics Enable annotation quoting for multi-line expressions (#9142) 2023-12-15 01:03:09 +00:00
ruff_formatter Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_index Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_linter Add cell indexes to all diagnostics (#9387) 2024-01-04 14:02:23 +00:00
ruff_macros remove several uses of unsafe (#8600) 2023-11-28 09:50:03 -05:00
ruff_notebook Generate deterministic ids when formatting notebooks (#9359) 2024-01-04 09:19:00 -06:00
ruff_python_ast Misc. small tweaks from perusing modules (#9383) 2024-01-03 12:30:25 -05:00
ruff_python_codegen Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
ruff_python_formatter Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_python_index Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_python_literal Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_python_parser Ignore trailing quotes for unclosed l-brace errors (#9388) 2024-01-04 05:00:55 +00:00
ruff_python_resolver Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_python_semantic Misc. small tweaks from perusing modules (#9383) 2024-01-03 12:30:25 -05:00
ruff_python_stdlib Treat all typing_extensions members as typing aliases (#9335) 2023-12-31 14:23:33 -04:00
ruff_python_trivia Use a sorted vector for block comments (#9337) 2023-12-31 19:52:40 +00:00
ruff_shrinking Bump version to 0.1.11 (#9370) 2024-01-02 17:46:06 -05:00
ruff_source_file Add cell indexes to all diagnostics (#9387) 2024-01-04 14:02:23 +00:00
ruff_text_size Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_wasm Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_workspace Add paths to toml parse errors (#9358) 2024-01-02 11:56:51 -05:00