-
Notifications
You must be signed in to change notification settings - Fork 0
/
roclet.R
43 lines (37 loc) · 929 Bytes
/
roclet.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
#' Roclet for 'roxygen2' style linting
#'
#' Roclets used to embed linters during documentation. To use, add the roclet in
#' your `DESCRIPTION` file.
#'
#' ```
#' Config/Needs/documentation: roxylint
#' Roxygen:
#' list(
#' markdown = TRUE,
#' roclets = c("namespace", "rd", "roxylint::roxylint")
#' )
#' ```
#'
#' @return A `roxylint` [roxygen2::roclet()].
#'
#' @export
roxylint <- function() {
roxygen2::roclet("roxylint")
}
#' @exportS3Method roxygen2::roclet_process roclet_roxylint
#' @noRd
roclet_process.roclet_roxylint <- function(x, blocks, env, base_path) { # nolint
config <- config_load()
for (block in blocks) {
for (x in block$tags) {
linters <- config$linters[[x$tag]]
check_linter(linters, x)
}
}
invisible(NULL)
}
#' @exportS3Method roxygen2::roclet_output roclet_roxylint
#' @noRd
roclet_output.roclet_roxylint <- function(...) { # nolint
invisible(NULL)
}