ruff/crates
Dylan 46fe17767d
Pass Checker by immutable reference to lint rules (#16012)
This very large PR changes the field `.diagnostics` in the `Checker`
from a `Vec<Diagnostic>` to a `RefCell<Vec<Diagnostic>>`, adds methods
to push new diagnostics to this cell, and then removes unnecessary
mutability throughout all of our lint rule implementations.

Consequently, the compiler may now enforce what was, till now, the
_convention_ that the only changes to the `Checker` that can happen
during a lint are the addition of diagnostics[^1].

The PR is best reviewed commit-by-commit. I have tried to keep the large
commits limited to "bulk actions that you can easily see are performing
the same find/replace on a large number of files", and separate anything
ad-hoc or with larger diffs. Please let me know if there's anything else
I can do to make this easier to review!

Many thanks to [`ast-grep`](https://github.com/ast-grep/ast-grep),
[`helix`](https://github.com/helix-editor/helix), and good ol'
fashioned`git` magic, without which this PR would have taken the rest of
my natural life.

[^1]: And randomly also the seen variables violating `flake8-bugbear`?
2025-02-07 09:05:50 -06:00
..
red_knot [red-knot] fix unresolvable import range (#15976) 2025-02-05 14:01:58 -05:00
red_knot_project Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
red_knot_python_semantic [red-knot] Unpacker: Make invariant explicit and directly return a Type (#16018) 2025-02-07 12:00:04 +00:00
red_knot_server [red-knot] Make Diagnostic::file optional (#15640) 2025-01-23 10:43:14 +01:00
red_knot_test [red-knot] Fixup a couple of nits in the red_knot_test README (#15996) 2025-02-06 15:04:27 +00:00
red_knot_vendored Sync vendored typeshed stubs (#15864) 2025-02-01 01:01:58 +00:00
red_knot_wasm Update Rust crate rand to 0.9.0 (#15899) 2025-02-03 12:25:57 +01:00
ruff Bump version to 0.9.5 (#16002) 2025-02-06 13:24:45 -06:00
ruff_annotate_snippets Fix docstring in ruff_annotate_snippets (#15748) 2025-01-26 22:25:29 -05:00
ruff_benchmark Vendor benchmark test files (#15878) 2025-02-02 18:16:07 +00:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
ruff_dev Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
ruff_diagnostics Show errors for attempted fixes only when passed --verbose (#15237) 2025-01-03 08:50:13 -06:00
ruff_formatter Upgrade Rust toolchain to 1.84.0 (#15408) 2025-01-11 09:51:58 +01:00
ruff_graph Add support for configuring knot in pyproject.toml files (#15493) 2025-01-17 09:41:06 +01: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 Pass Checker by immutable reference to lint rules (#16012) 2025-02-07 09:05:50 -06:00
ruff_macros Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
ruff_notebook Update Rust crate rand to 0.9.0 (#15899) 2025-02-03 12:25:57 +01:00
ruff_python_ast [red-knot] Merge Markdown code blocks inside a single section (#15950) 2025-02-05 22:26:15 +01:00
ruff_python_ast_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_codegen Preserve triple quotes and prefixes for strings (#15818) 2025-02-04 08:41:06 -05:00
ruff_python_formatter Workaround Even Better TOML crash related to allOf (#15992) 2025-02-06 16:00:50 +01:00
ruff_python_index Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_literal Preserve triple quotes and prefixes for strings (#15818) 2025-02-04 08:41:06 -05:00
ruff_python_parser Simplify the StringFlags trait (#15944) 2025-02-04 18:14:28 +00:00
ruff_python_resolver Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_semantic [flake8-simplify] Only trigger SIM401 on known dictionaries (SIM401) (#15995) 2025-02-07 08:25:20 +00:00
ruff_python_stdlib Revert "Add all PEP-585 names to UP006 rule" (#15250) 2025-01-04 12:23:53 +01:00
ruff_python_trivia [red-knot] Hand-written MDTest parser (#15926) 2025-02-04 14:01:53 +01:00
ruff_python_trivia_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_server Consider unsafe-fixes settings for code actions (#15666) 2025-01-22 13:44:13 +05:30
ruff_source_file [pyupgrade] Do not report when a UTF-8 comment is followed by a non-UTF-8 one (UP009) (#14728) 2024-12-11 10:30:41 +00:00
ruff_text_size [ruff] itertools.starmap(..., zip(...)) (RUF058) (#15483) 2025-01-16 15:18:12 +01:00
ruff_wasm Bump version to 0.9.5 (#16002) 2025-02-06 13:24:45 -06:00
ruff_workspace Config error only when flake8-import-conventions alias conflicts with isort.required-imports bound name (#15918) 2025-02-04 17:05:35 -06:00