Skip to content

Handle FAST003 aliases from Annotated type aliases#25208

Open
ya-nsh wants to merge 1 commit into
astral-sh:mainfrom
ya-nsh:fix/fast003-annotated-alias
Open

Handle FAST003 aliases from Annotated type aliases#25208
ya-nsh wants to merge 1 commit into
astral-sh:mainfrom
ya-nsh:fix/fast003-annotated-alias

Conversation

@ya-nsh
Copy link
Copy Markdown

@ya-nsh ya-nsh commented May 17, 2026

Summary

  • Teach FAST003 to resolve Annotated[..., Path(alias=...)] aliases through same-file type aliases.
  • Scan all Annotated metadata entries so aliases are recognized when Path(...) is not the first metadata element.
  • Add FAST003 regression coverage for direct aliased type aliases and multi-metadata aliases.

Related to #16795.

Test Plan

  • cargo test -p ruff_linter --lib rules::fastapi::tests::rules::rule_fastapiunusedpathparameter_path_new_fast003_py_expects --features test-rules -- --nocapture
  • cargo test -p ruff_linter --lib rules::fastapi::tests::deferred_annotations_diff::rule_fastapiunusedpathparameter_path_new_fast003_py_expects --features test-rules -- --nocapture
  • cargo test -p ruff_linter --lib rules::fastapi::tests --features test-rules -- --nocapture
  • cargo fmt --check
  • uvx prek run --from-ref origin/main

@astral-sh-bot astral-sh-bot Bot requested a review from ntBre May 17, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants