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.
This PR adds mypy and baseline type-checking infrastructure to CI and the project's scripts.
For this PR, type checking is restricted to the interceptors, and follow-up PRs can add annotations and checking to other files individually. I've done this to prevent the size of this PR from getting out of hand.
When adding annotations to a previously unannotated file, we'll add that file (or directory, if possible) to the
types
script's list of explicit places to check. After we've annotated all ofsrc/pook
, we can condense the list down to just that. Finally, we'll enable type checking for the tests.Ideally, the addition of annotations does not require introducing runtime code changes. At times, though, it seems like it will be, if the types are to be useful for Pook itself (rather than just on the surface for users). It's certainly better if the project itself has correct and useful annotations to rely on, rather than just API-surface level stubs. The reason for that are: