Skip to content

Commit

Permalink
feat: add mypy for type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
KarelZe committed Jan 9, 2024
1 parent a694fb8 commit 18e6999
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
# yaml requires additional stubs.
# Similar to: https://stackoverflow.com/a/73603491/5755604
additional_dependencies: ['types-PyYAML']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.11
hooks:
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,24 @@ version = {attr = "forensicsim.__version__"}
dev=[
"build",
"pre-commit",
"mypy",
"ruff",
"tox",
]

[tool.mypy]

python_version = "3.9"

exclude = [
"tools/"
]

# https://github.com/python/mypy/issues/2410
ignore_missing_imports = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_incomplete_defs = true

[tool.ruff]

Expand Down Expand Up @@ -103,6 +117,7 @@ commands =
# Syntax Checks
[testenv:lint]
commands =
python -m mypy src/
python -m ruff --output-format=github src
python -m ruff format src --check
Expand Down

0 comments on commit 18e6999

Please sign in to comment.