ruff/crates/ruff_linter/resources/test
Micha Reiser 92193a3254 Consider all TYPE_CHECKING symbols for type-checking blocks (#16669)
## Summary

This PR stabilizes the preview behavior introduced in
https://github.com/astral-sh/ruff/pull/15719 to recognize all symbols
named `TYPE_CHECKING` as type-checking
checks in `if TYPE_CHECKING` conditions. This ensures compatibility with
mypy and pyright.

This PR also stabilizes the new behavior that removes `if 0:` and `if
False` to be no longer considered type checking blocks.
Since then, this syntax has been removed from the typing spec and was
only used for Python modules that don't have a `typing` module
([comment](https://github.com/astral-sh/ruff/pull/15719#issuecomment-2612787793)).

The preview behavior was first released with Ruff 0.9.5 (6th of
February), which was about a month ago. There are no open issues or PRs
for the changed behavior


## Test Plan

The snapshots for `SIM108` change because `SIM108` ignored type checking
blocks but it can no
simplify `if 0` or `if False` blocks again because they're no longer
considered type checking blocks.

The changes in the `TC005` snapshot or only due to that `if 0` and `if
False` are no longer recognized as type checking blocks

<!-- How was it tested? -->
2025-03-13 15:37:37 +01:00
..
fixtures Consider all TYPE_CHECKING symbols for type-checking blocks (#16669) 2025-03-13 15:37:37 +01:00
package Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00
project Rename ruff_cli crate to ruff (#9557) 2024-01-16 17:47:01 -05:00
__init__.py [pylint] (Re-)Implement import-private-name (C2701) (#9553) 2024-01-16 14:03:11 -05:00
disallowed_rule_names.txt Rename ruff crate to ruff_linter (#7529) 2023-09-20 08:38:27 +02:00