View source: R/02_checkStyle.R
selectLinters | R Documentation |
Used in checkStyle
.
If you want to customize the set of tested linters, you can
Specify the file type
("script" or "pkgFuns") to add linters
exclude particular linters to the default linter set via
excludeLinters
add linters via addLinters
excludeLinters
is evaluated in the end, i.e., it affects all linters
included by default, file type, or addLinters
.
selectLinters(type = NULL, excludeLinters = list(), addLinters = list())
type |
character: Type of the file ( |
excludeLinters |
character vector: Names of linters to be excluded |
addLinters |
list: Named list of linter functions to be added |
The following linters are always included:
function_argument_linter
,
assignment_linter
,
commas_linter
,
double_space_linter
,
infix_spaces_linter
,
undesirable_operator_linter
,
line_length_linter
,
whitespace_linter
,
object_length_linter
,
options_linter
,
spaces_left_parentheses_linter
,
trailing_blank_lines_linter
,
trailing_whitespaces_linter
,
The following linters are only included if type = "pkgFuns"
:
setwd_linter
,
source_linter
The following linters are only included if type = "script"
:
(currently empty)
Named list of linter functions
selectLinters(type = "script",
excludeLinters = c("object_length_linter", "function_argument_linter"),
addLinters = list(setwd_l = setwd_linter,
source_l = source_linter))
# Code listing tested linters:
linterNames <- sort(names(selectLinters()))
packages <- unlist(lapply(linterNames,
function(name) {
erg <- help.search(name)
erg$matches$Package
}))
# nolint start
cat("#' \\itemize{\n#'",
paste0(" \\item\\code{\\link[", packages, "]{", linterNames, "}}",
collapse = ",\n#' "), "\n#' }")
# nolint end
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.