mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-25 02:54:01 +03:00
00ff825b8c
Add djangorestframework-stubs to local.txt requirements Modify setup.cfg to add stubs to mypy settings Fix new type error in DRF `./users/api/views.py:19: error: Incompatible type for lookup 'id': (got "Union[AutoField[Union[Combinable, int, str], int], Any]", expected "Union[str, int]")` by asserting that `self.request.user.id` is an int
41 lines
1.0 KiB
INI
41 lines
1.0 KiB
INI
[flake8]
|
|
max-line-length = 120
|
|
exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv
|
|
|
|
[pycodestyle]
|
|
max-line-length = 120
|
|
exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules,venv
|
|
|
|
[isort]
|
|
line_length = 88
|
|
known_first_party = {{cookiecutter.project_slug}},config
|
|
multi_line_output = 3
|
|
default_section = THIRDPARTY
|
|
skip = venv/
|
|
skip_glob = **/migrations/*.py
|
|
include_trailing_comma = true
|
|
force_grid_wrap = 0
|
|
use_parentheses = true
|
|
|
|
[mypy]
|
|
python_version = 3.9
|
|
check_untyped_defs = True
|
|
ignore_missing_imports = True
|
|
warn_unused_ignores = True
|
|
warn_redundant_casts = True
|
|
warn_unused_configs = True
|
|
plugins = mypy_django_plugin.main{% if cookiecutter.use_drf == "y" %}, mypy_drf_plugin.main{% endif %}
|
|
|
|
[mypy.plugins.django-stubs]
|
|
django_settings_module = config.settings.test
|
|
|
|
[mypy-*.migrations.*]
|
|
# Django migrations should not produce any errors:
|
|
ignore_errors = True
|
|
|
|
[coverage:run]
|
|
include = {{cookiecutter.project_slug}}/*
|
|
omit = *migrations*, *tests*
|
|
plugins =
|
|
django_coverage_plugin
|