Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pre-commit/mirrors-mypy
Mirror of mypy for pre-commit
https://github.com/pre-commit/mirrors-mypy
Last synced: about 2 months ago
JSON representation
Mirror of mypy for pre-commit
- Host: GitHub
- URL: https://github.com/pre-commit/mirrors-mypy
- Owner: pre-commit
- License: mit
- Created: 2018-05-30T21:34:21.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-09T08:30:52.000Z (7 months ago)
- Last Synced: 2024-04-14T08:02:15.283Z (5 months ago)
- Language: Python
- Size: 42 KB
- Stars: 239
- Watchers: 13
- Forks: 38
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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`
```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:```yaml
hooks:
- id: mypy
args: [--strict, --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:```yaml
hooks:
- id: mypy
additional_dependencies: [tokenize-rt==3.2.0]
```Note that using the `--install-types` is problematic. Mutating the pre-commit
environment at runtime breaks cache and will break parallel builds.