Repository navigation
Add ty check - #1003
Open
besendorf wants to merge 3 commits into
Open
Add ty check#1003besendorf wants to merge 3 commits into
besendorf wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
"ty" (https://github.com/astral-sh/ty) is a fast Python type checker developed by Astral, the maintainers of Ruff and uv, both of which MVT already uses. With the release of ty 1.0, it is worth evaluating as a potential replacement for mypy.
Beyond significantly faster type checking, ty offers improved type inference, better typing specification conformance, and native language server support. Its ability to analyze partially annotated code is particularly relevant to MVT, where many existing forensic modules are not fully typed.
Given the security-sensitive nature of MVT and its use in digital forensic investigations, improved static analysis could help identify programming errors that might otherwise result in incomplete or incorrect analysis.
This PR introduces ty alongside mypy rather than replacing it immediately. Initially running ty as a non-blocking CI check allows us to evaluate its diagnostics, identify genuine issues, assess false positives, and address existing typing problems without disrupting development.
Once the findings have been evaluated, we can decide whether to enforce ty in CI and eventually replace mypy, reducing tooling complexity and improving developer feedback times.