Skip to content

Commit

Permalink
Add: Add autohooks-plugin-mypy to check types with mypy
Browse files Browse the repository at this point in the history
Enable checking for the type hints via mypy during the pre commit hooks
using autohooks.
  • Loading branch information
bjoernricks committed Jul 27, 2023
1 parent 5764589 commit 1479d46
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 3 deletions.
63 changes: 62 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ python-dateutil = ">=2.8.2"
semver = ">=2.13"
lxml = ">=4.9.0"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
autohooks = ">=22.7.0"
autohooks-plugin-black = ">=22.7.0"
autohooks-plugin-isort = ">=22.3.0"
autohooks-plugin-ruff = ">=23.6.1"
autohooks-plugin-mypy = ">=23.3.0"
rope = ">=1.9.0"
coverage = ">=7.2"
myst-parser = ">=0.19.1"
Expand All @@ -75,7 +76,7 @@ exclude = '''
'''

[tool.autohooks]
pre-commit = ['autohooks.plugins.black', 'autohooks.plugins.isort', 'autohooks.plugins.ruff']
pre-commit = ['autohooks.plugins.black', 'autohooks.plugins.isort', 'autohooks.plugins.ruff', 'autohooks.plugins.mypy']
mode = "poetry"

[tool.isort]
Expand All @@ -86,6 +87,17 @@ line_length = 80
line-length = 80
target-version = "py39"

[tool.mypy]
files = "pontos"
ignore_missing_imports = true
explicit_package_bases = true
allow_redefinition = true
exclude = 'pontos/updateheader/templates/.*/*\.py'

[[tool.mypy.overrides]]
module = "dateutil"
ignore_missing_imports = true

[tool.pontos.version]
version-module-file = "pontos/version/__version__.py"

Expand Down

0 comments on commit 1479d46

Please sign in to comment.