Skip to content

Commit 87c70a3

Browse files
committed
fix(pre-commit): use uv run mypy for proper config loading
Changed from mirrors-mypy repo to local repo using 'uv run mypy --package app' to ensure: 1. Project virtual environment is used 2. pyproject.toml mypy config is properly loaded 3. Module naming conflicts are avoided
1 parent 85abee4 commit 87c70a3

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,16 @@ repos:
1919
args: [--config, server/pyproject.toml]
2020
files: ^server/
2121

22-
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: v1.14.0
22+
# Use local mypy via uv to ensure project venv and pyproject.toml config are used
23+
- repo: local
2424
hooks:
2525
- id: mypy
26-
additional_dependencies:
27-
- pydantic>=2.11.1
28-
- sqlalchemy[stubs]>=2.0.40
29-
- types-requests>=2.31.0
30-
- types-python-dateutil>=2.8.0
31-
- types-aiofiles>=23.2.0
32-
args: [--config-file, server/pyproject.toml]
26+
name: mypy
27+
entry: bash -c "cd server && uv run mypy --package app"
28+
language: system
3329
pass_filenames: false
34-
entry: bash -c "cd server && mypy app/"
3530
files: ^server/
31+
types: [python]
3632

3733
- repo: https://github.com/PyCQA/bandit
3834
rev: 1.8.0

0 commit comments

Comments
 (0)