Skip to content

Commit

Permalink
chore(pre-commit): add mypy
Browse files Browse the repository at this point in the history
This commit adds mypy to the pre-commit hooks. This is executed through
`hatch` as mypy needs to be able to find and parse dependencies in
hatch's virtual environment.

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Oct 26, 2023
1 parent 6911385 commit 678cd00
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ repos:
hooks:
- id: commitizen
stages: [commit-msg]

- repo: local
hooks:
# Mypy is difficult to run pre-commit's isolated environment as it needs
# to be able to find dependencies.
- id: mypy
name: mypy
entry: hatch run mypy
language: system
types: [python]
exclude: ^(pact|tests)/(?!v3/).*\.py$
stages: [pre-push]

0 comments on commit 678cd00

Please sign in to comment.