Skip to content

Commit

Permalink
Move mypy conf for it to work as intended
Browse files Browse the repository at this point in the history
The quotes around the regex was originally added to comply with TOML linting, but this turned out to break the configuration. Therefore the conf had to be moved away from the TOML file.

After moving it, it appeared we were missing a required section for the `django-stubs` plugin, so that was also included.
  • Loading branch information
ivarnakken committed Jul 3, 2023
1 parent b6d2f10 commit b0dcfb1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 39 deletions.
40 changes: 40 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[mypy]
python_version = 3.11
plugins = mypy_django_plugin.main, mypy_drf_plugin.main
ignore_missing_imports = true
allow_untyped_globals = true
check_untyped_defs = true
show_error_codes = true
follow_imports = silent
strict_equality = true
no_implicit_optional = true
warn_incomplete_stub = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
warn_unreachable = true
warn_return_any = true
enable_error_code = ignore-without-code
disable_error_code = annotation-unchecked
strict_concatenate = false
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true

[mypy-*.tests.*]
check_untyped_defs = false
disallow_incomplete_defs = false
disallow_subclassing_any = false
disallow_untyped_calls = false
disallow_untyped_decorators = false
disallow_untyped_defs = false
warn_return_any = false
warn_unreachable = false

[mypy-*.migrations.*]
ignore_errors = true

[mypy.plugins.django-stubs]
django_settings_module = "lego.settings"
40 changes: 1 addition & 39 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sentry-sdk = "1.25.0"
analytics-python = "1.2.9"
#
# channels
channels = {version = "4.0.0", extras = ["daphne"]}
channels = { version = "4.0.0", extras = ["daphne"] }
channels_redis = "4.1.0"
# Implicit dependency
flatbuffers = "23.5.26"
Expand Down Expand Up @@ -118,44 +118,6 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


[tool.mypy]
python_version = 3.11
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
ignore_missing_imports = true
allow_untyped_globals = true
check_untyped_defs = true
show_error_codes = true
follow_imports = "silent"
strict_equality = true
no_implicit_optional = true
warn_incomplete_stub = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
warn_unreachable = true
warn_return_any = true
enable_error_code = "ignore-without-code"
disable_error_code = "annotation-unchecked"
strict_concatenate = false
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true

[tool."mypy-*.tests.*"]
check_untyped_defs = false
disallow_incomplete_defs = false
disallow_subclassing_any = false
disallow_untyped_calls = false
disallow_untyped_decorators = false
disallow_untyped_defs = false
warn_return_any = false
warn_unreachable = false

[tool."mypy-*.migrations.*"]
ignore_errors = true

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

Expand Down

0 comments on commit b0dcfb1

Please sign in to comment.