-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (64 loc) · 1.68 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
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
80
81
82
all:
reports/activity_3.pdf: reports/activity_3.tex
$(renderLatex)
reports/activity_3.tex: reports/non-tabular/results.json
jinja-render \
--report-name "activity_3" \
--summary-path "reports/non-tabular/results.json"
reports/activity_2.pdf: reports/activity_2.tex
$(renderLatex)
reports/activity_2.tex: reports/non-tabular/results.json
jinja-render \
--report-name "activity_2" \
--summary-path "reports/non-tabular/results.json"
reports/activity_1.pdf: reports/activity_1.tex
$(renderLatex)
reports/activity_1.tex: reports/non-tabular/results.json
jinja-render \
--report-name "activity_1" \
--summary-path "reports/non-tabular/results.json"
reports/non-tabular/results.json:
$(checkDirectories)
echo '{"A":2 , "B":3 , "total":5}' > reports/non-tabular/results.json
.PHONY: \
all \
check \
clean \
format \
init \
linter \
setup \
tests
define checkDirectories
mkdir --parents $(@D)
endef
define lint
pylint \
--disable=bad-continuation \
--disable=missing-class-docstring \
--disable=missing-function-docstring \
--disable=missing-module-docstring \
${1}
endef
define renderLatex
cd $(<D) && pdflatex $(<F)
cd $(<D) && pdflatex $(<F)
endef
check:
@echo "🤖💄 Nothing to check. If we add a python file check Black, mypy and flake 8."
clean:
rm --force --recursive reports/*.aux
rm --force --recursive reports/*.log
rm --force --recursive reports/*.out
rm --force --recursive reports/*.pdf
rm --force --recursive reports/*.tex
rm --force --recursive reports/non-tabular/results.json
format:
black --line-length 100 src
init: setup tests
linter:
$(call lint, src)
setup: clean
shellspec --init
tests:
shellspec