Skip to content

Instantly share code, notes, and snippets.

@philipp-leanix
Last active October 20, 2022 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipp-leanix/6aedaae4e03253add85e2b0d4436da9d to your computer and use it in GitHub Desktop.
Save philipp-leanix/6aedaae4e03253add85e2b0d4436da9d to your computer and use it in GitHub Desktop.
Example configs for mypy, interrogate, flake8 and pre-commit
[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
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
[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