Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (67 loc) · 1.48 KB
/
Copy pathMakefile
File metadata and controls
79 lines (67 loc) · 1.48 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
67
68
69
70
71
72
73
74
75
76
77
78
79
OK_MSG = "Done! ✔"
SHELL = bash
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(RUN_ARGS):;@:)
ifeq ($(strip $(RUN_ARGS)),)
RUN_ARGS := .
endif
env: lint_requirements.txt
@( \
echo -e "==> Creating virtualenv..."; \
python3 -m venv lint_env; \
source ./lint_env/bin/activate; \
pip install -r lint_requirements.txt \
)
@echo $(OK_MSG)
env-clean:
@rm -rf lint_env/
@echo $(OK_MSG)
code-format:
@( \
source ./lint_env/bin/activate; \
python3 -m black $(RUN_ARGS); \
)
@echo $(OK_MSG)
@echo $(RUN_ARGS)
code-format-check:
@( \
source ./lint_env/bin/activate; \
python3 -m black $(RUN_ARGS) --check; \
)
@echo $(OK_MSG)
flake-lint:
@( \
source ./lint_env/bin/activate; \
python3 -m flake8 $(RUN_ARGS); \
)
@echo $(OK_MSG)
pylint:
@( \
source ./lint_env/bin/activate; \
find $(RUN_ARGS) -type f -iname "*.py" -not -path "*/lint_env/*" -not -path "*/env/*" -not -path "*/venv/*" -exec python3 -m pylint {} \; ;\
)
@echo $(OK_MSG)
isort:
@( \
source ./lint_env/bin/activate; \
python3 -m isort $(RUN_ARGS); \
)
@echo $(OK_MSG)
isort-check:
@( \
source ./lint_env/bin/activate; \
python3 -m isort $(RUN_ARGS) --check-only; \
)
@echo $(OK_MSG)
lint:
@( \
source ./lint_env/bin/activate; \
python3 -m isort $(RUN_ARGS); \
python3 -m black $(RUN_ARGS); \
python3 -m flake8 $(RUN_ARGS); \
)
@echo $(OK_MSG)
clean:
@find . -type f -name "*.py[co]" -delete
@find . -type d -name "__pycache__" -delete
@echo $(OK_MSG)