Chore: Enable mypy checking in CI (#11991)

This commit is contained in:
Trenton H
2026-02-03 16:02:33 -08:00
committed by GitHub
parent 6ad2fc0356
commit fb7abf7a6e
5 changed files with 2569 additions and 28 deletions

View File

@@ -138,7 +138,9 @@ typing = [
"django-stubs[compatible-mypy]",
"djangorestframework-stubs[compatible-mypy]",
"lxml-stubs",
"microsoft-python-type-stubs @ git+https://github.com/microsoft/python-type-stubs.git",
"mypy",
"mypy-baseline",
"types-bleach",
"types-colorama",
"types-dateparser",
@@ -333,10 +335,6 @@ exclude_also = [
[tool.mypy]
mypy_path = "src"
files = [
"src/documents/plugins/date_parsing",
"src/documents/tests/date_parsing",
]
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
@@ -348,28 +346,9 @@ disallow_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
# This prevents errors from imports, but allows type-checking logic to work
follow_imports = "silent"
[[tool.mypy.overrides]]
module = [
"documents.*",
"paperless.*",
"paperless_ai.*",
"paperless_mail.*",
"paperless_tesseract.*",
"paperless_remote.*",
"paperless_text.*",
"paperless_tika.*",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = [
"documents.plugins.date_parsing.*",
"documents.tests.date_parsing.*",
]
ignore_errors = false
[tool.django-stubs]
django_settings_module = "paperless.settings"
[tool.mypy-baseline]
baseline_path = ".mypy-baseline.txt"
sort_baseline = true