-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (53 loc) · 1.97 KB
/
Makefile
File metadata and controls
66 lines (53 loc) · 1.97 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ifeq (, $(shell which docker-compose))
docker_compose=docker compose
else
docker_compose=docker-compose
endif
-include Makefile.perso.mk
###########################
# colors #
###########################
PRINT_COLOR = printf
COLOR_SUCCESS = \033[1;32m
COLOR_DEBUG = \033[36m
COLOR_RESET = \033[0m
.PHONY: serve
serve:
@$(PRINT_COLOR) "$(COLOR_SUCCESS) \n### Start server ###\n $(COLOR_RESET)\n"
$(docker_compose) up
###########################
# Lint #
###########################
.PHONY: format
format:
$(docker_compose) run --remove-orphans --no-deps --rm web ruff format mapentity test_project
.PHONY: lint
lint:
$(docker_compose) run --remove-orphans --no-deps --rm web ruff check --fix mapentity test_project
.PHONY: force_lint
force_lint:
$(docker_compose) run --remove-orphans --no-deps --rm web ruff check --fix --unsafe-fixes mapentity test_project
.PHONY: quality
quality: lint format
###########################
# Test #
###########################
verbose_level ?= 1
report ?= report -m
.PHONY: coverage
coverage:
@$(PRINT_COLOR) "$(COLOR_SUCCESS) ### Start coverage ### $(COLOR_RESET)\n"
$(docker_compose) run --rm -it web coverage run --parallel-mode --concurrency=multiprocessing ./manage.py test $(test_name) --parallel -v $(verbose_level) || true
$(docker_compose) run --rm -it web bash -c "coverage combine && coverage $(report)"
$(docker_compose) run --rm -it web coverage xml -o coverage.xml
rm .coverage* || true
verbose_level ?= 1
.PHONY: test
test:
@$(PRINT_COLOR) "$(COLOR_SUCCESS) ### Start tests ### $(COLOR_RESET)\n"
$(docker_compose) run --rm web ./manage.py test $(test_name) --parallel -v $(verbose_level)
messages_python:
$(docker_compose) run --rm web ./manage.py makemessages -a --no-location --no-obsolete --no-wrap
messages_js:
$(docker_compose) run --rm web ./manage.py makemessages -a -d djangojs --no-location --no-obsolete --no-wrap --ignore=node_modules/**
messages: messages_python messages_js