-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (32 loc) · 1.32 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
args := $(wordlist 2, 100, $(MAKECMDGOALS))
APPLICATION_NAME = ya_tracker_client
HELP_FUN = \
%help; while(<>){push@{$$help{$$2//'options'}},[$$1,$$3] \
if/^([\w-_]+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/}; \
print"$$_:\n", map" $$_->[0]".(" "x(20-length($$_->[0])))."$$_->[1]\n",\
@{$$help{$$_}},"\n" for keys %help; \
CODE = ya_tracker_client
TEST = poetry run python3 -m pytest --verbosity=2 --showlocals --log-level=DEBUG
ifndef args
MESSAGE = "No such command (or you pass two or many targets to ). List of possible commands: make help"
else
MESSAGE = "Done"
endif
help: ##@Help Show this help
@echo -e "Usage: make [target] ...\n"
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
install: ##@Setup Install project requirements
python3 -m pip install poetry
poetry install
test: ##@Testing Test application with pytest
$(TEST)
test-cov: ##@Testing Test application with pytest and create coverage report
$(TEST) --cov=$(APPLICATION_NAME) --cov-report html --cov-fail-under=85 --cov-config pyproject.toml
lint: ##@Code Check code with ruff
poetry run python3 -m ruff $(CODE) tests
format: ##@Code Reformat code with ruff
poetry run python3 -m ruff $(CODE) tests --fix
precommit: # Code Check code with pre-commit hooks
pre-commit run --all-files
clean: ##@Code Clean directory from garbage files
rm -fr *.egg-info dist