-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
37 lines (27 loc) · 949 Bytes
/
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
BLACK_LINE_MAXLEN = 88
PYLINT_THRESHOLD = 6
FIND_PY_FILES = find . -name "*.py" -not -path "./venv*" -not -path "*/migrations/*"
all: test check
# Start development server locally
run:
python manage.py runserver
# Check code formatting and run static type checker
check: check-black check-pylint check-mypy check-safety
check-black:
black --version
black -S -l $(BLACK_LINE_MAXLEN) --check . --force-exclude '/migrations/'
check-pylint:
pylint --version
$(FIND_PY_FILES) | xargs pylint --fail-under $(PYLINT_THRESHOLD) --rcfile setup.cfg
$(FIND_PY_FILES) | xargs reorder-python-imports --diff-only
check-mypy:
$(FIND_PY_FILES) | xargs mypy
check-safety:
cat requirements.txt | safety check --stdin
# Run regression tests
test:
bash RegressionTests/run.sh
# Install requirements needed for app development
install: requirements-dev.txt
pip install -r $<
.PHONY: all check check-black check-pylint check-mypy check-safety run test