-
Notifications
You must be signed in to change notification settings - Fork 0
/
mk.txt
47 lines (40 loc) · 1.16 KB
/
mk.txt
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
TEST_TARGET=teste.py
POETRY = poetry run
FLAKE8_FLAGS = --ignore=W503,E501
ISORT_FLAGS = --profile=black --lines-after-import=2
## @ instalacao
.PHONY: instalar
instalar: ## instala programa usando poetry, poetry precisa estar instalado
poetry install
## @ programa
.PHONY: rodar
rodar: saida.txt ## roda programa verificando dependencias em programa.py e entrada.txt
saida.txt: programa.py entrada.txt
${POETRY} python programa.py
## @ testes
.PHONY: teste cobertura
teste: ## Roda teste
${POETRY} pytest ${TEST_TARGET}
cobertura: ##roda cobertura de testes
${POETRY} pytest --cov=. --cov-report=html $(TEST_TARGET)
## @ analise
.PHONY: lint_black flake mypy lint_isort analise
lint_black:
${POETRY} black --check .
flake:
${POETRY} flake8 ${FLAKE8_FLAGS} .
mypy:
${POETRY} mypy .
lint_isort:
${POETRY} isort ${ISORT_FLAGS} --check .
analise: lint_black flake mypy lint_isort ## roda analise estatica: black, flake, mypy e isort
## @ formatacao
.PHONY: black isort formatar
black:
${POETRY} black .
isort:
${POETRY} isort ${ISORT_FLAGS} .
formatar: isort black ## roda formatacao nos arquivos da pasta usando black e isort
.PHONY: ajuda
ajuda:
@${POETRY} python ajuda.py