-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 1.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.PHONY: test run
all: test run
discover-linter=find . -type f -name "*.py" -not -path "./*/migrations/*"
discover-style-checker=find . -type f -name "*.py" -not -path "./*/migrations/*" -not -iname "*models.py*" -not -iname "*apps.py"
discover-type-checker=find . -type f -name "*.py" -not -path "./*/migrations/*" -not -iname "*models.py*" -not -iname "*apps.py"
discover-dead-code-checker=find . -type f -name "*.py" -not -path "./*/migrations/*"
pylint:
@echo testing with pylint
@${discover-linter} | xargs poetry run pylint
flake8:
@echo "testing with flake8"
@${discover-style-checker} | xargs poetry run flake8
mypy:
@echo "testing with mypy"
@${discover-type-checker} | xargs poetry run mypy
vulture:
@echo "testing with vulture"
@${discover-dead-code-checker} | xargs poetry run vulture
servertests:
@rm project/db.sqlite3 | echo no old test db
@poetry run coverage run --source=. manage.py test --settings project.settings.testing
@poetry run coverage report
@poetry run coverage html
test: pylint flake8 mypy servertests
@echo All tests successful
migrate:
@echo Making Migrations ...
@poetry run python manage.py makemigrations
@echo Applying Migrations ...
@poetry run python manage.py migrate
adminuser:
@poetry run python manage.py createsuperuser
run: migrate
@echo running server ...
@poetry run python manage.py runserver