Visitar URL original
GitHub - pre-commit/mirrors-mypy: Mirror of mypy for pre-commit
The Wayback Machine - https://web.archive.org/web/20201204125308/https://github.com/pre-commit/mirrors-mypy
Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Oct 10, 2020
Oct 10, 2020

README.md

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]

About

Mirror of mypy for pre-commit

Resources

Packages

No packages published

Languages

You can’t perform that action at this time.