ruff/crates
David Salvisberg 4366473d9b
[flake8-type-checking] Fix some safe fixes being labeled unsafe (#15638)
## Summary

We were mistakenly using `CommentRanges::has_comments` to determine
whether our edits
were safe, which sometimes expands the checked range to the end of a
line. But in order to
determine safety we need to check exactly the range we're replacing.

This bug affected the rules `runtime-cast-value` (`TC006`) and
`quoted-type-alias` (`TC008`)
although it was very unlikely to be hit for `TC006` and for `TC008` we
never hit it because we
were checking the wrong expression.

## Test Plan

`cargo nextest run`
2025-01-21 15:08:46 +01:00
..
red_knot Flatten red_knot_project import paths (#15616) 2025-01-20 14:57:57 +01:00
red_knot_project Flatten red_knot_project import paths (#15616) 2025-01-20 14:57:57 +01:00
red_knot_python_semantic [red-knot] Markdown test runner (#15632) 2025-01-21 14:06:35 +01:00
red_knot_server Flatten red_knot_project import paths (#15616) 2025-01-20 14:57:57 +01:00
red_knot_test [red-knot] Markdown test runner (#15632) 2025-01-21 14:06:35 +01:00
red_knot_vendored [red-knot] Migrate is_gradual_equivalent_to unit tests to Markdown tests (#15563) 2025-01-17 16:48:01 -08:00
red_knot_wasm Flatten red_knot_project import paths (#15616) 2025-01-20 14:57:57 +01:00
ruff show-settings: Properly filter out backslashes on windows (#15612) 2025-01-20 10:57:21 +01:00
ruff_annotate_snippets ruff_annotate_snippets: support overriding the "cut indicator" 2025-01-15 13:37:52 -05:00
ruff_benchmark Flatten red_knot_project import paths (#15616) 2025-01-20 14:57:57 +01:00
ruff_cache
ruff_db Remove workspace support (#15472) 2025-01-15 09:03:38 +01:00
ruff_dev
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
ruff_linter [flake8-type-checking] Fix some safe fixes being labeled unsafe (#15638) 2025-01-21 15:08:46 +01:00
ruff_macros Flatten red_knot_project import paths (#15616) 2025-01-20 14:57:57 +01:00
ruff_notebook
ruff_python_ast Standardise ruff config (#15558) 2025-01-21 12:09:11 +01:00
ruff_python_ast_integration_tests
ruff_python_codegen
ruff_python_formatter Standardise ruff config (#15558) 2025-01-21 12:09:11 +01:00
ruff_python_index
ruff_python_literal
ruff_python_parser Parse triple quoted string annotations as if parenthesized (#15387) 2025-01-16 11:38:15 +05:30
ruff_python_resolver
ruff_python_semantic [pylint] Include name of base class in message for redefined-slots-in-subclass (W0244) (#15559) 2025-01-18 09:50:27 -06: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 type: ignore[codes] and knot: ignore (#15078) 2024-12-23 10:52:43 +01:00
ruff_python_trivia_integration_tests
ruff_server Avoid indexing the same workspace multiple times (#15495) 2025-01-15 18:58:28 +05:30
ruff_source_file
ruff_text_size [ruff] itertools.starmap(..., zip(...)) (RUF058) (#15483) 2025-01-16 15:18:12 +01:00
ruff_wasm Bump version to 0.9.2 (#15529) 2025-01-16 13:07:26 +00:00
ruff_workspace [pydoclint] Allow ignoring one line docstrings for DOC rules (#13302) 2025-01-16 16:05:10 -06:00