ruff/crates/ruff_linter
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
..
resources [`flake8-type-checking`] Fix some safe fixes being labeled unsafe (#15638) 2025-01-21 15:08:46 +01:00
src [`flake8-type-checking`] Fix some safe fixes being labeled unsafe (#15638) 2025-01-21 15:08:46 +01:00
Cargo.toml Bump version to 0.9.2 (#15529) 2025-01-16 13:07:26 +00:00