File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,9 +49,10 @@ repos:
4949 name : Check typing annotations
5050 entry : mypy
5151 language : python
52- files : ^src/package/|^tests/
52+ files : ^src/package/|^tests/ # Declare files to run the hook only when necessary.
5353 types : [text, python]
54- args : [--explicit-package-bases, --config-file, pyproject.toml]
54+ pass_filenames : false
55+ args : [--config-file, pyproject.toml]
5556
5657# Enable a whole bunch of useful helper hooks, too.
5758# See https://pre-commit.com/hooks.html for more hooks.
Original file line number Diff line number Diff 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
129136show_error_codes = true
130137show_column_numbers = true
131138pretty = true
@@ -146,11 +153,12 @@ disallow_untyped_decorators = true
146153# disable_error_code =
147154# allow_redefinition =
148155
156+ # https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
149157[[tool .mypy .overrides ]]
150158module = [
151- " pytest.*" ,
152159]
153- ignore_missing_imports = true
160+ follow_untyped_imports = true
161+ # ignore_missing_imports = true
154162
155163
156164# https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html
You can’t perform that action at this time.
0 commit comments