Skip to content

Commit 8338fb1

Browse files
authored
Run mypy in pre-commit (#190)
1 parent e7b8701 commit 8338fb1

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ repos:
1919
hooks:
2020
- id: blacken-docs
2121
additional_dependencies: [black==20.8b1]
22+
# Use a local hook to run because the official hook runs mypy in a venv
23+
# that doesn't have dependencies or their type annotations installed.
24+
- repo: local
25+
hooks:
26+
- id: mypy
27+
name: mypy
28+
entry: mypy
29+
language: system
30+
types: [python]

tox.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ commands = pytest {posargs}
1515
extras = lint
1616
commands =
1717
pre-commit run --all-files
18-
; Run mypy outside pre-commit because pre-commit runs mypy in a venv
19-
; that doesn't have dependencies or their type annotations installed.
20-
mypy .
2118

2219
; Below tasks are for development only (not run in CI)
2320

0 commit comments

Comments
 (0)