diff options
author | Ran Benita <ran234@gmail.com> | 2019-07-08 10:04:19 +0300 |
---|---|---|
committer | Anthony Sottile <asottile@umich.edu> | 2019-07-09 12:12:07 -0700 |
commit | 89dfde95353651f12474621becd808e2330371da (patch) | |
tree | d11533d3bb63d4e3ef699ec1c35e3536bbd02408 /.pre-commit-config.yaml | |
parent | 628ff4d61908fb42bd9260fa910f1ddb082196df (diff) | |
download | pytest-89dfde95353651f12474621becd808e2330371da.tar.gz |
Add rudimentary mypy type checking
Add a very lax mypy configuration, add it to tox -e linting, and
fix/ignore the few errors that come up. The idea is to get it running
before diving in too much.
This enables:
- Progressively adding type annotations and enabling more strict
options, which will improve the codebase (IMO).
- Annotating the public API in-line, and eventually exposing it to
library users who use type checkers (with a py.typed file).
Though, none of this is done yet.
Refs https://github.com/pytest-dev/pytest/issues/3342.
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r-- | .pre-commit-config.yaml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12fa0d343..fce7978c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,6 +28,7 @@ repos: hooks: - id: flake8 language_version: python3 + additional_dependencies: [flake8-typing-imports] - repo: https://github.com/asottile/reorder_python_imports rev: v1.4.0 hooks: @@ -42,6 +43,17 @@ repos: rev: v1.4.0 hooks: - id: rst-backticks +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.711 + hooks: + - id: mypy + name: mypy (src) + files: ^src/ + args: [] + - id: mypy + name: mypy (testing) + files: ^testing/ + args: [] - repo: local hooks: - id: rst |