generated from IslasGECI/templater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·76 lines (61 loc) · 1.71 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
all: check coverage
.PHONY: \
check \
clean \
coverage \
format \
green \
init \
install \
red \
refactor \
setup \
tests
check:
R -e "library(styler)" \
-e "resumen <- style_dir('R')" \
-e "resumen <- rbind(resumen, style_dir('tests'))" \
-e "resumen <- rbind(resumen, style_dir('tests/testthat'))" \
-e "any(resumen[[2]])" \
| grep FALSE
clean:
rm --force *.tar.gz
rm --force --recursive tests/testthat/_snaps
rm --force NAMESPACE
coverage: setup tests
Rscript tests/testthat/coverage.R
format:
R -e "library(styler)" \
-e "style_dir('R')" \
-e "style_dir('tests')" \
-e "style_dir('tests/testthat')"
init: setup tests
git config --global --add safe.directory /workdir
git config --global user.name "Ciencia de Datos • GECI"
git config --global user.email "[email protected]"
mutants:
@echo "En espera del doctorado de Evaristo 👾🎉🎓"
setup: clean install
red: format
Rscript -e "devtools::test(stop_on_failure = TRUE)" \
&& git restore . \
|| (git add tests/testthat/*.R && git commit -m "🛑🧪 Fail tests")
chmod g+w -R .
green: format
Rscript -e "devtools::test(stop_on_failure = TRUE)" \
&& (git add R/*.R && git commit -m "✅ Pass tests") \
|| git restore .
chmod g+w -R .
refactor: format
Rscript -e "devtools::test(stop_on_failure = TRUE)" \
&& (git add R/*.R tests/testthat/*.R && git commit -m "♻️ Refactor") \
|| git restore .
chmod g+w -R .
setup: clean install
install:
R -e "devtools::document()" && \
R CMD build . && \
R CMD check geci.diversity_0.1.0.tar.gz && \
R CMD INSTALL geci.diversity_0.1.0.tar.gz
tests:
Rscript -e "devtools::test(stop_on_failure = TRUE)"