Repository navigation
Add ty to CI - #4546
Add ty to CI#4546
Conversation
| - name: Check uv.lock is up to date | ||
| if: matrix.python == '3.11' | ||
| run: uv lock --check | ||
| - name: Install | ||
| run: make install | ||
| - name: Run linters | ||
| if: matrix.python == '3.11' | ||
| run: make lint | ||
| - name: Run type checker | ||
| if: matrix.python == '3.11' | ||
| run: make typecheck |
There was a problem hiding this comment.
nit: maybe we can combined these
|
ty did introduce a baseline feature (where you commit a list of individual violations to be ignored), but the feature is in beta + in a file format that they've promised to change with new versions. We've already got a type checker, so this method just seems easier. |
| uv run $(PYTHON_ARG) prek run -a | ||
|
|
||
| typecheck: ## Run the ty type checker | ||
| uv run $(PYTHON_ARG) ty check --exit-zero-on-warning |
There was a problem hiding this comment.
we probably should remove --exit-zero-on-warning later otherwise this wont enforce 😄
There was a problem hiding this comment.
I removed it, but that's not fully the case. The ty docs say ty will only exit with 1 if it finds violations with severity error or higher. if that flag is enabled.
Nonetheless, I removed the flag + added a couple more ignores. We can punt that decision depending on how much churn it makes.
|
ty! |
Rationale for this change
ty recently hit 1.0. With that in mind, let's officially add it to our CI.
I'm currently disabling a lot of type checker rules so that we can add ty in phases. After we add it in CI, we can begin removing these rules one-by-one and then remove mypy.
Are these changes tested?
CI should pass.
Are there any user-facing changes?