/
devtools_check.R
158 lines (133 loc) · 3.43 KB
/
devtools_check.R
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#' @name packageCheck
#' @aliases check_slow check
#'
#' @title Run package checks
#'
#' @param pkg Package location passed to \code{devtools::check()}.
#'
#' @return No return.
#'
#' @description When multiple developers are working on a package, it is
#' crucially important that they check their code changes \emph{often}. After
#' merging changes from multiple developers it is equally important to check the
#' package \emph{thoroughly}.
#'
#' The problem is that frequent checks should be quick or developers won't do
#' them while thorough checks are, by nature, slow.
#'
#' Our solution is to provide shorthand functions that wrap
#' \code{devtools::check()} and pass it a variety of different arguments.
#'
#' @details The table below describes the \code{args} passed to
#' \code{devtools::check()}:
#'
#' \tabular{rl}{
#' \code{check_slowest()} \tab | \code{manual = TRUE, run_dont_test = TRUE} \cr
#' \tab | \code{args = c("--run-dontrun", "--use-gct")}\cr
#' \code{check_slower()} \tab | \code{manual = TRUE, run_dont_test = TRUE} \cr
#' \tab | \code{args = c("--run-dontrun")}\cr
#' \code{check_slow()} \tab | \code{manual = TRUE, run_dont_test = TRUE}\cr
#' \tab | \code{args = c()}\cr
#' \code{check()} \tab | \code{manual = FALSE, run_dont_test = FALSE} \cr
#' \tab | \code{args = c()}\cr
#' \code{check_fast()} \tab | \code{manual = FALSE, run_dont_test = FALSE} \cr
#' \tab | \code{build_args = c("--no-build-vignettes")}\cr
#' \tab | \code{args = c("--ignore-vignettes")}\cr
#' \code{check_faster()} \tab | \code{manual = FALSE, run_dont_test = FALSE} \cr
#' \tab | \code{build_args = c("--no-build-vignettes")}\cr
#' \tab | \code{args = c("--ignore-vignettes", "--no-examples")}\cr
#' \code{check_fastest()} \tab | \code{manual = FALSE, run_dont_test = FALSE} \cr
#' \tab | \code{build_args = c("--no-build-vignettes")}\cr
#' \tab | \code{args = c("--ignore-vignettes", "--no-examples", "--no-tests")}\cr
#' }
#'
#'
#' @seealso \code{\link[devtools]{check}}
#'
NULL
#' @rdname packageCheck
#' @export
check <- function(
pkg = "."
) {
devtools::check(
pkg = pkg,
manual = FALSE,
run_dont_test = FALSE
)
}
#' @rdname packageCheck
#' @export
check_fast <- function(
pkg = "."
) {
devtools::check(
pkg = pkg,
manual = FALSE,
run_dont_test = FALSE,
build_args = c("--no-build-vignettes"),
args = c("--ignore-vignettes")
)
}
#' @rdname packageCheck
#' @export
check_faster <- function(
pkg = "."
) {
devtools::check(
pkg = pkg,
manual = FALSE,
run_dont_test = FALSE,
build_args = c("--no-build-vignettes"),
args = c("--ignore-vignettes", "--no-examples")
)
}
#' @rdname packageCheck
#' @export
check_fastest <- function(
pkg = "."
) {
devtools::check(
pkg = pkg,
manual = FALSE,
run_dont_test = FALSE,
build_args = c("--no-build-vignettes"),
args = c("--ignore-vignettes", "--no-tests",
"--no-examples")
)
}
#' @rdname packageCheck
#' @export
check_slow <- function(
pkg = "."
) {
devtools::check(
pkg = pkg,
manual = TRUE,
run_dont_test = TRUE,
)
}
#' @rdname packageCheck
#' @export
check_slower <- function(
pkg = "."
) {
devtools::check(
pkg = pkg,
manual = TRUE,
run_dont_test = TRUE,
args = c("--run-dontrun")
)
}
#' @rdname packageCheck
#' @export
check_slowest <- function(
pkg = "."
) {
devtools::check(
pkg = pkg,
manual = TRUE,
run_dont_test = TRUE,
args = c("--run-dontrun", "--use-gct")
)
}