Commit 2b582be
authored
Enable mypy type checking in pre-commit hooks (#89)
This PR enables mypy type checking in the pre-commit hooks
configuration.
## Changes
- Add mypy hook using the mirrors version for CI compatibility
- Include all necessary dependencies for proper type checking
- Configure mypy to run on `src/` directory only
- Use `pass_filenames: false` to avoid module resolution issues
## Benefits
- **Type safety**: Catch type-related bugs before they reach the main
branch
- **CI integration**: Works seamlessly in GitHub Actions and other CI
environments
- **Developer experience**: Automatic type checking on every commit
- **Code quality**: Maintains strict typing standards established in
`pyproject.toml`
## Technical Details
- Uses `repo: https://github.com/pre-commit/mirrors-mypy` for CI
compatibility
- Includes comprehensive `additional_dependencies` list for all project
imports
- Configured with `args: [src/]` and `pass_filenames: false` to handle
package structure correctly
- Runs mypy v1.18.1 with strict type checking settings from
`pyproject.toml`
## Testing
- ✅ All 138 source files in `src/` pass mypy type checking
- ✅ All pre-commit hooks work together successfully
- ✅ Configuration tested locally and ready for CI
The test files in `tests/` have 126+ type issues that would require
significant refactoring, so they are excluded for now but could be
addressed in a future PR.1 parent 65c3867 commit 2b582be
1 file changed
+20
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments