Skip to content

Commit ec3a5b1

Browse files
committed
feat(*): add make test-style targets
This gives us an opporunity to run code checkers and linters as part of testing, as we used to on travis-ci.org. By default, unit tests will check code syntax and style first.
1 parent 39b38a1 commit ec3a5b1

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ coverage:
4141
coverage run manage.py test --noinput api
4242
coverage html
4343

44-
flake8:
45-
flake8
46-
4744
test: test-unit test-functional
4845

49-
test-unit:
46+
setup-venv:
5047
@if [ ! -d venv ]; then virtualenv venv; fi
5148
venv/bin/pip install -q -r requirements.txt -r dev_requirements.txt
49+
50+
test-style: setup-venv
51+
venv/bin/flake8
52+
53+
test-unit: setup-venv test-style
5254
venv/bin/python manage.py test --noinput api
5355

5456
test-functional:

dev_requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ coverage>=3.7.1
1919
docutils>=0.12
2020

2121
# Run "make flake8" to check python syntax and style
22-
flake8==2.1.0
23-
pep8==1.4.6
24-
pyflakes==0.7.3
22+
flake8==2.2.2
2523

2624
# Used for mocking endpoints
2725
mock==1.0.1

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
max-line-length = 99
3-
exclude = */api/migrations/*,*/api/south_migrations/*,*/build/*,*/venv/*,*/virtualenv/*,*/scheduler/*,*/templates/*
3+
exclude = api/migrations,api/south_migrations,templates,venv
44
max-complexity = 12

0 commit comments

Comments
 (0)