Skip to content

Commit

Permalink
Update mypy setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Jun 24, 2024
1 parent f1d7003 commit c1567ef
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 50 deletions.
3 changes: 2 additions & 1 deletion comics/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def get_ordered_images(self):
os.umask(0o002)

image_storage = FileSystemStorage(
location=settings.MEDIA_ROOT, base_url=settings.MEDIA_URL
location=settings.MEDIA_ROOT, # type: ignore # noqa: PGH003
base_url=settings.MEDIA_URL, # type: ignore # noqa: PGH003
)


Expand Down
46 changes: 43 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,46 @@ filterwarnings = [
DJANGO_SETTINGS_MODULE = "comics.settings"


[tool.django-stubs]
django_settings_module = "comics.settings"


[tool.mypy]
no_implicit_optional = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
plugins = ["mypy_django_plugin.main"]

[[tool.mypy.overrides]]
module = "comics.aggregator.crawler"
disallow_untyped_defs = true
warn_return_any = true

[[tool.mypy.overrides]]
module = "comics.core.comic_data"
disallow_untyped_defs = true
warn_return_any = true

[[tool.mypy.overrides]]
module = "comics.*.migrations.*"
ignore_errors = true

[[tool.mypy.overrides]]
module = [
"debug_toolbar.*",
"django_extensions.*",
"environ.*",
"feedparser.*",
"invitations.*",
"lxml.*",
"PIL.*",
"tastypie.*",
]
ignore_missing_imports = true


[tool.ruff]
target-version = "py312"

Expand Down Expand Up @@ -87,7 +127,7 @@ select = [
"PLW", # pylint warning
#"PT", # flake8-pytest-style # TODO
#"PTH", # flake8-use-pathlib # TODO
"Q", # flake8-quotes
"Q", # flake8-quotes
#"RET", # flake8-return # TODO
"RSE", # flake8-raise
"RUF", # ruff
Expand All @@ -97,8 +137,8 @@ select = [
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
#"TRY", # tryceratops # TODO
"UP", # pyupgrade
"W", # pycodestyle
"UP", # pyupgrade
"W", # pycodestyle
]
ignore = [
"A003", # builtin-attribute-shadowing
Expand Down
46 changes: 0 additions & 46 deletions setup.cfg

This file was deleted.

0 comments on commit c1567ef

Please sign in to comment.