forked from zelenij/django-bootstrap-v5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (37 loc) · 984 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
38
39
40
41
42
43
44
45
46
47
.PHONY: test tox reformat lint docs porcelain branch build publish
PROJECT_DIR=src/bootstrap5
PYTHON_SOURCES=${PROJECT_DIR} tests *.py
test:
coverage run manage.py test
coverage report
tox:
rm -rf .tox
tox
reformat:
autoflake -ir --remove-all-unused-imports ${PYTHON_SOURCES}
isort ${PYTHON_SOURCES}
docformatter -ir --pre-summary-newline --wrap-summaries=0 --wrap-descriptions=0 ${PYTHON_SOURCES}
black .
lint:
flake8 ${PYTHON_SOURCES}
pydocstyle --add-ignore=D1,D202,D301,D413 ${PYTHON_SOURCES}
docs:
cd docs && sphinx-build -b html -d _build/doctrees . _build/html
porcelain:
ifeq ($(shell git status --porcelain),)
@echo "Working directory is clean."
else
@echo "Error - working directory is dirty. Commit those changes!";
@exit 1;
endif
branch:
ifeq ($(shell git rev-parse --abbrev-ref HEAD),main)
@echo "On branch main."
else
@echo "Error - Not on branch main!"
@exit 1;
endif
build: docs
poetry build
publish: porcelain branch build
poetry publish