Skip to content

👷 Add ty to the CI lint check#1477

Merged
tiangolo merged 11 commits intofastapi:masterfrom
svlandeg:feat/ty-ci
Feb 10, 2026
Merged

👷 Add ty to the CI lint check#1477
tiangolo merged 11 commits intofastapi:masterfrom
svlandeg:feat/ty-ci

Conversation

@svlandeg
Copy link
Member

@svlandeg svlandeg commented Jan 6, 2026

For now, running ty in parallel to mypy to see what kind of errors/warnings come up.

@svlandeg svlandeg changed the title 👷 Add ty in the CI lint check 👷 Add ty to the CI lint check Jan 6, 2026
@svlandeg svlandeg self-assigned this Jan 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

@svlandeg svlandeg added repo / tests Involving the CI / test suite internal labels Jan 6, 2026
@svlandeg
Copy link
Member Author

svlandeg commented Jan 7, 2026

Ok this is ready for review @tiangolo.

TLDR decisions to take:

  • Do we resolve issues with assert and cast statements (first few commits in this PR) or by using ignore statements (final commits & current state)? I think mostly in our repo's we've been resorting to ignore statements so far.
  • If we want ignore statements, are we happy with ty: ignore? I'd prefer it because 1) ty doesn't support type: ignore with specific violations between brackets, and 2) if we use type: ignore, mypy will complain, and we'd have to put type: ignore[unused-ignore] which will work because of 1) but feels ugly/hacky.
  • Do we want to resolve also ty warnings even if they don't fail the CI? (if yes, we can also enforce this via the CI with --error-on-warning

@svlandeg svlandeg marked this pull request as ready for review January 7, 2026 10:55
@svlandeg svlandeg removed their assignment Jan 7, 2026
Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This looks great, I think the current state is perfect.

We could evolve this later, but I think it's good as it is right now. 🚀

@tiangolo tiangolo merged commit b45fbab into fastapi:master Feb 10, 2026
25 checks passed
@svlandeg svlandeg deleted the feat/ty-ci branch February 11, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal repo / tests Involving the CI / test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants