mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-05 06:00:59 +03:00
Merge pull request #1706 from apirobot/mypy
Add mypy to the local dependencies
This commit is contained in:
commit
4b6e2b503a
|
@ -14,6 +14,9 @@ cd .cache/docker
|
|||
cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y
|
||||
cd my_awesome_project
|
||||
|
||||
# run the project's type checks
|
||||
docker-compose -f local.yml run django mypy my_awesome_project
|
||||
|
||||
# run the project's tests
|
||||
docker-compose -f local.yml run django pytest
|
||||
|
||||
|
|
|
@ -32,6 +32,15 @@ Setting Up Your Users
|
|||
|
||||
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
|
||||
|
||||
Type checks
|
||||
^^^^^^^^^^^
|
||||
|
||||
Running type checks with mypy:
|
||||
|
||||
::
|
||||
|
||||
$ mypy {{cookiecutter.project_slug}}
|
||||
|
||||
Test coverage
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ psycopg2-binary==2.7.5 # https://github.com/psycopg/psycopg2
|
|||
|
||||
# Testing
|
||||
# ------------------------------------------------------------------------------
|
||||
mypy==0.620 # https://github.com/python/mypy
|
||||
pytest==3.7.3 # https://github.com/pytest-dev/pytest
|
||||
pytest-sugar==0.9.1 # https://github.com/Frozenball/pytest-sugar
|
||||
|
||||
|
|
|
@ -5,3 +5,17 @@ exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules
|
|||
[pycodestyle]
|
||||
max-line-length = 120
|
||||
exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules
|
||||
|
||||
[mypy]
|
||||
python_version = 3.6
|
||||
check_untyped_defs = True
|
||||
ignore_errors = False
|
||||
ignore_missing_imports = True
|
||||
strict_optional = True
|
||||
warn_unused_ignores = True
|
||||
warn_redundant_casts = True
|
||||
warn_unused_configs = True
|
||||
|
||||
[mypy-*.migrations.*]
|
||||
# Django migrations should not produce any errors:
|
||||
ignore_errors = True
|
||||
|
|
Loading…
Reference in New Issue
Block a user