diff --git a/.gitignore b/.gitignore index 7a66dd1d21ad4fa083df3dab1e92adb5fa04703a..df483879638dceb1e84c209c4567fae6286e9f52 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ wheels/ .installed.cfg *.egg + +# Cache +.mypy_cache/ diff --git a/.travis.yml b/.travis.yml index 3c233c388f43b5b0da642e848eec4ca6ed062bbb..26694aaaf580e3e50c5b4e1225f26dd5c932d8bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,13 +35,13 @@ install: # Install project dependencies - pip install -r requirements.txt - # Install test dependencies - - pip install flake8 - # Run the tests script: # Run python code style checks - - flake8 opentech --ignore=E501,F405 --exclude=*/migrations/* + - flake8 + + # Type check the project + - mypy . # Run system checks - python manage.py check diff --git a/opentech/apply/admin.py b/opentech/apply/admin.py index 8c38f3f3dad51e4585f3984282c2a4bec5349c1e..4185d360e9a725a190ddfd9b8cce8aeb0df64cc3 100644 --- a/opentech/apply/admin.py +++ b/opentech/apply/admin.py @@ -1,3 +1,3 @@ -from django.contrib import admin +# from django.contrib import admin # Register your models here. diff --git a/opentech/apply/models.py b/opentech/apply/models.py index 71a836239075aa6e6e4ecb700e9c42c95c022d91..0b4331b362b98a4e5947c491612f95a3c2e56686 100644 --- a/opentech/apply/models.py +++ b/opentech/apply/models.py @@ -1,3 +1,3 @@ -from django.db import models +# from django.db import models # Create your models here. diff --git a/opentech/apply/tests.py b/opentech/apply/tests.py index 7ce503c2dd97ba78597f6ff6e4393132753573f6..a79ca8be565f44aacce95bad20c1ee34d175ed20 100644 --- a/opentech/apply/tests.py +++ b/opentech/apply/tests.py @@ -1,3 +1,3 @@ -from django.test import TestCase +# from django.test import TestCase # Create your tests here. diff --git a/opentech/apply/views.py b/opentech/apply/views.py index 91ea44a218fbd2f408430959283f0419c921093e..fd0e0449559b2e00e226cc9f96df7caed44172aa 100644 --- a/opentech/apply/views.py +++ b/opentech/apply/views.py @@ -1,3 +1,3 @@ -from django.shortcuts import render +# from django.shortcuts import render # Create your views here. diff --git a/requirements.txt b/requirements.txt index 77bc48b15c9cfe9bd91a4621f56e342a6e0ce67f..62cc28d588b9785c386fc88336b4cca8b2fe556c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,8 @@ Werkzeug==0.11.11 stellar==0.4.3 wagtail-django-recaptcha==0.1 uwsgidecorators==1.1.0 +mypy==0.550 +flake8 # Production dependencies dj-database-url==0.4.1 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000000000000000000000000000000000..c6e0c156292251fb1e830d6de120b0fb0ad45a29 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,14 @@ +[mypy] +show_column_numbers = True +ignore_missing_imports = True + +[mypy-opentech.*] +ignore_errors = True + +[mypy-opentech.apply.*] +check_untyped_defs = True +ignore_errors = False + +[flake8] +ignore=E501,F405 +exclude=*/migrations/*