ruff/crates
Takayuki Maeda 12c337c948
[RUF102] Respect rule redirects in invalid rule code detection (#20245)
<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Fixes #20235

• Fix `RUF102` to properly handle rule redirects when validating noqa
codes
• Update `code_is_valid` to check redirect targets before determining
validity
• Add test case for rule redirects (TCH002 in this case)

## Test Plan

<!-- How was it tested? -->

I have added a test case for rule redirects to
`crates/ruff_linter/resources/test/fixtures/ruff/RUF102.py`.
2025-09-10 14:27:07 -07:00
..
ruff Bump 0.13.0 (#20336) 2025-09-10 12:11:22 -04:00
ruff_annotate_snippets Move full diagnostic rendering to ruff_db (#19415) 2025-08-08 12:56:23 -04:00
ruff_benchmark [ty] Benchmarks for problematic implicit instance attributes cases (#20133) 2025-08-28 15:25:25 +02:00
ruff_cache Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_db Refactor diagnostic start|end location helpers (#20309) 2025-09-09 11:39:31 -07:00
ruff_dev [ty] Remove duplicate global lint registry (#20053) 2025-08-22 19:43:12 -04:00
ruff_diagnostics Fix rust feature activation (#20012) 2025-08-21 09:26:06 +02:00
ruff_formatter Add support for using uv as an alternative formatter backend (#19665) 2025-09-09 20:39:53 +05:30
ruff_graph [ty] Remove KnownModule::is_enum (#19681) 2025-08-01 10:31:12 +02:00
ruff_index Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
ruff_linter [RUF102] Respect rule redirects in invalid rule code detection (#20245) 2025-09-10 14:27:07 -07:00
ruff_macros Don't cache files with diagnostics (#19869) 2025-08-12 15:28:44 -04:00
ruff_memory_usage [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00
ruff_notebook Improve diff rendering for notebooks (#20036) 2025-08-25 09:20:42 -04:00
ruff_options_metadata Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
ruff_python_ast [flake8-bandit] Fix truthiness: dict-only ** displays not truthy for shell (S602, S604, S609) (#20177) 2025-09-10 17:06:33 -04:00
ruff_python_ast_integration_tests Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
ruff_python_codegen Expose Indentation in ruff_python_codegen (#20216) 2025-09-03 13:32:31 -04:00
ruff_python_formatter Add support for using uv as an alternative formatter backend (#19665) 2025-09-09 20:39:53 +05:30
ruff_python_index Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_literal Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_parser [syntax-errors] Detect yield from inside async function (#20051) 2025-09-03 10:13:05 -04:00
ruff_python_semantic Add a ScopeKind for the __class__ cell (#20048) 2025-08-26 09:49:08 -04:00
ruff_python_stdlib Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_trivia [ruff] Preserve relative whitespace in multi-line expressions (RUF033) (#19647) 2025-08-27 19:15:44 +00:00
ruff_python_trivia_integration_tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_server Add support for using uv as an alternative formatter backend (#19665) 2025-09-09 20:39:53 +05:30
ruff_source_file Move diff rendering to ruff_db (#20006) 2025-08-21 09:47:00 -04:00
ruff_text_size [ty] Fix a few more diagnostic differences from Ruff (#19806) 2025-08-08 11:31:19 -04:00
ruff_wasm Bump 0.13.0 (#20336) 2025-09-10 12:11:22 -04:00
ruff_workspace Stabilize adding future import via config option (#20277) 2025-09-10 09:00:27 -04:00
ty [ty] Include python folder in environment.root if it exists (#20263) 2025-09-05 13:53:48 +02:00
ty_combine [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
ty_ide [ty] Add support for generic PEP695 type aliases (#20219) 2025-09-08 13:26:21 -07:00
ty_project [ty] Include python folder in environment.root if it exists (#20263) 2025-09-05 13:53:48 +02:00
ty_python_semantic [ty] Fix CallableTypeOf[…] for bound methods (#20338) 2025-09-10 21:13:23 +02:00
ty_server Allow the if_not_else Clippy lint 2025-09-09 08:49:25 -04:00
ty_static [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
ty_test [ty] Add functions for revealing assignability/subtyping constraints (#20217) 2025-09-03 16:44:35 -04:00
ty_vendored [ty] Add mdtests that exercise constraint sets (#20319) 2025-09-10 13:22:19 -04:00
ty_wasm [ty] Make auto-import completions opt-in via an experimental option 2025-09-03 09:57:26 -04:00