Skip to content

Commit e580d7a

Browse files
committed
fix: improve mypy settings such that it collects all package and test files instead of using the files passed in by pre-commit
1 parent fb2e31c commit e580d7a

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ repos:
4949
name: Check typing annotations
5050
entry: mypy
5151
language: python
52-
files: ^src/package/|^tests/
53-
types: [text, python]
54-
args: [--explicit-package-bases, --config-file, pyproject.toml]
52+
pass_filenames: false
53+
args: [--config-file, pyproject.toml]
5554

5655
# Enable a whole bunch of useful helper hooks, too.
5756
# See https://pre-commit.com/hooks.html for more hooks.

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,15 @@ exclude = [
124124

125125
# https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml
126126
[tool.mypy]
127-
# mypy_path =
127+
files = [
128+
"src/package/",
129+
"tests/",
130+
]
128131
# exclude =
132+
mypy_path = [
133+
"src/",
134+
]
135+
explicit_package_bases = true
129136
show_error_codes = true
130137
show_column_numbers = true
131138
pretty = true

0 commit comments

Comments
 (0)