Go to file
2021-02-20 08:40:38 +00:00
.github Add link to GitHub Sponsors + Open Collective 2020-11-19 17:12:22 -08:00
.pre-commit-hooks.yaml v0.670-1 2019-03-14 20:25:47 -07:00
.version Mirror: 0.812 2021-02-20 08:40:38 +00:00
README.md explicitly call out additional_dependencies 2020-01-08 08:19:50 -08:00
setup.py Mirror: 0.812 2021-02-20 08:40:38 +00:00

mypy mirror

Mirror of mypy for pre-commit.

For pre-commit: see https://github.com/pre-commit/pre-commit For mypy: see https://github.com/python/mypy

Using mypy with pre-commit:

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/pre-commit/mirrors-mypy
    rev: ''  # Use the sha / tag you want to point at
    hooks:
    -   id: mypy

By default, mypy will run with mypy --ignore-missing-imports, pre-commit runs mypy from an isolated virtualenv so it won't have access to those. To change the arguments, override the args as follows:

    hooks:
    -   id: mypy
        args: [--no-strict-optional, --ignore-missing-imports]

Because pre-commit runs mypy from an isolated virtualenv (without your dependencies) you may also find it useful to add the typed dependencies to additional_dependencies so mypy can better perform dynamic analysis:

    hooks:
    -   id: mypy
        additional_dependencies: [tokenize-rt==3.2.0]