-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
48 lines (40 loc) · 1.12 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
46
47
48
VIRTUAL_ENV_PATH=venv
SKIP_VENV="${NO_VENV}"
PYPI_API_KEY :=
PYPI_REPOSITORY_URL :=
ALPHA_VERSION :=
SHELL := /bin/bash
.DEFAULT_GOAL := pre_commit
pre_commit: format lint
flake8:
@( \
set -e; \
if [ -z $(SKIP_VENV) ]; then source $(VIRTUAL_ENV_PATH)/bin/activate; fi; \
echo "Runing Flake8 checks..."; \
flake8 ./custom_components/prana --count --statistics; \
echo "DONE: Flake8"; \
)
mypy:
@( \
set -e; \
if [ -z $(SKIP_VENV) ]; then source $(VIRTUAL_ENV_PATH)/bin/activate; fi; \
echo "Runing MyPy checks..."; \
mypy --show-error-codes ./custom_components/prana; \
echo "DONE: MyPy"; \
)
lint: flake8 mypy
clean:
@(rm -rf custom_components/build dist/* *.egg-info custom_components/*.egg-info .pytest_cache)
format:
@( \
if [ -z $(SKIP_VENV) ]; then source $(VIRTUAL_ENV_PATH)/bin/activate; fi; \
echo "Runing Black code formater..."; \
black ./custom_components/prana; \
echo "DONE: Black"; \
)
venv:
@( \
virtualenv $(VIRTUAL_ENV_PATH); \
source ./venv/bin/activate; \
pip install -r ./requirements.txt; \
)