-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
79 lines (60 loc) · 1.97 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
PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//')
RSCRIPT = Rscript --no-init-file
FILE_TARGET := "R/${FILE}"
.PHONY: docs
install: doc build
R CMD INSTALL . && rm *.tar.gz
build:
R CMD build .
doc:
${RSCRIPT} -e "devtools::document()"
docs:
${RSCRIPT} -e "pkgdown::build_site(); pkgdown::preview_site(preview=TRUE)"
eg:
${RSCRIPT} -e "devtools::run_examples(run_dontrun = TRUE)"
check: build
_R_CHECK_CRAN_INCOMING_=FALSE R CMD CHECK --as-cran --no-manual `ls -1tr ${PACKAGE}*gz | tail -n1`
@rm -f `ls -1tr ${PACKAGE}*gz | tail -n1`
@rm -rf ${PACKAGE}.Rcheck
vign_getting_started:
cd vignettes;\
${RSCRIPT} -e "Sys.setenv(NOT_CRAN='true'); knitr::knit('sixtyfour.Rmd.og', output = 'sixtyfour.Rmd')";\
cd ..
vign_billing:
cd vignettes;\
${RSCRIPT} -e "Sys.setenv(NOT_CRAN='true'); knitr::knit('billing.Rmd.og', output = 'billing.Rmd')";\
cd ..
vign_db:
cd vignettes;\
${RSCRIPT} -e "Sys.setenv(NOT_CRAN='true'); knitr::knit('databases.Rmd.og', output = 'databases.Rmd')";\
cd ..
test:
SIXTYFOUR_RUN_LOCAL_ONLY_TESTS=true ${RSCRIPT} -e "devtools::test()"
readme:
${RSCRIPT} -e "knitr::knit('README.Rmd')"
lint_package:
${RSCRIPT} -e "lintr::lint_package()"
# use: `make style_file FILE=stuff.R`
# ("R/" is prepended); accepts 1 file only
style_file:
${RSCRIPT} -e 'styler::style_file(${FILE_TARGET})'
style_package:
${RSCRIPT} -e "styler::style_pkg()"
update_data:
${RSCRIPT} -e "source('data-raw/service-mapping.R')"
scan_secrets:
@echo "scanning for leaks in commits\n"
gitleaks detect --source . -v
@echo "\n\n\n"
@echo "scanning for leaks in uncommitted files\n"
gitleaks protect --source . -v
minio_start:
MINIO_USER=${MINIO_USER} ;\
MINIO_PWD=${MINIO_PWD} ;\
MINIO_ENDPOINT=${MINIO_ENDPOINT} ;\
minio server /tmp/minio --console-address :9090
localstack_start:
ifeq (, $(shell command -v localstack))
$(error "No localstack detected. See https://docs.localstack.cloud/getting-started/installation/")
endif
localstack start