Skip to content

Commit

Permalink
Mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
iurisilvio committed Feb 7, 2024
1 parent 3ff72e2 commit a15f47e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion django_migrations_ci/management/commands/migrateci.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.core.management.base import BaseCommand, CommandError

try:
from django.test.runner import get_max_test_processes
from django.test.runner import get_max_test_processes # type: ignore[attr-defined]
except ImportError:
# Django<4
def get_max_test_processes():
Expand Down
2 changes: 1 addition & 1 deletion django_migrations_ci/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def pytest_configure(config):
return

try:
from pytest_django import plugin
from pytest_django import plugin # type: ignore[import-untyped]

db_unblock = config.stash[plugin.blocking_manager_key].unblock
except AttributeError:
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ precision = 2
show_missing = true
skip_covered = true

[tool.mypy]
exclude = [
"example/",
]

[tool.ruff.lint]
select = ["ALL"]
ignore = [
Expand Down
2 changes: 1 addition & 1 deletion tests/testapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class Bus(models.Model):
plate = models.TextField()
plate = models.TextField() # type: ignore[var-annotated]
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ commands =
ruff --check .
ruff format --check .


[testenv:mypy]
description = lint source code
deps =
mypy
commands =
mypy .


[gh-actions]
python =
3.10: py310
Expand Down

0 comments on commit a15f47e

Please sign in to comment.