-
-
Save philipp-leanix/6aedaae4e03253add85e2b0d4436da9d to your computer and use it in GitHub Desktop.
Example configs for mypy, interrogate, flake8 and pre-commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[flake8] | |
# see https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8 | |
ignore=E203,W503 | |
max-line-length=88 | |
filename=*.py | |
exclude=.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repos: | |
- repo: https://github.com/psf/black | |
rev: 22.6.0 | |
hooks: | |
- id: black | |
language_version: python3.10 | |
- repo: https://gitlab.com/pycqa/flake8 | |
rev: 4.0.1 | |
hooks: | |
- id: flake8 | |
- repo: https://github.com/econchick/interrogate | |
rev: 1.5.0 | |
hooks: | |
- id: interrogate | |
# don't pass filenames, this way interrogate runs for the whole dir | |
# and uses the config in pyproject.toml, ignoring tests | |
pass_filenames: false | |
- repo: https://github.com/pre-commit/mirrors-mypy | |
rev: v0.971 | |
hooks: | |
- id: mypy | |
pass_filenames: false | |
language: system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool] | |
# ... | |
[tool.mypy] | |
disallow_untyped_defs=true | |
check_untyped_defs=true | |
follow_imports="normal" | |
warn_unused_ignores=true | |
warn_unreachable=true | |
pretty=true | |
plugins="pydantic.mypy, sqlalchemy.ext.mypy.plugin" | |
[tool.interrogate] | |
ignore-nested-classes = true | |
ignore-nested-functions = true | |
ignore-private = true | |
ignore-semiprivate = true | |
ignore-init-method = true | |
ignore-setters = true | |
ignore-property-decorators = true | |
verbose = 1 | |
fail-under = 95 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment