Provided a list of linters for a given tag, iterate over linters to raise alerts during the documentation process.
Usage
check_linter(linters, tag, ...)
# S3 method for default
check_linter(linters, tag, ...)
# S3 method for list
check_linter(linters, tag, ...)
# S3 method for `function`
check_linter(linters, tag, ...)
# S3 method for character
check_linter(linters, tag, message = NULL, ...)
Arguments
- linters
A linters specification, either a
function
orcharacter
regular expression that should be matched, or alist
of either. See details for more information.- tag
- ...
Additional arguments unused.
- message
An optional message to use for an alert.
Value
TRUE
, invisibly. However, this function is primarily used for its
side-effect of raising alerts during documentation.
Methods (by class)
check_linter(default)
: By default, no linting is performedcheck_linter(list)
: Alist
offunction
s orcharacter
regular expressions.If a
character
value is named, the name is used as the message for a alert that is raised when the expression does not match.check_linter(`function`)
: Afunction
to evaluate for the given tagfunction
's are evaluated with the following arguments:The contents of the tag's
$val
, as named arguments
Because the number of arguments might not be readily apparent, any function should accept a trailing
...
argument.Provided
function
s may print lint output, or signal lint output with messages or warnings. Acli::cli_alert()
will reflect the severity of the function used to emit the output.check_linter(character)
: Acharacter
regular expressions.If a
character
value is found, its value is assumed to be a regular expression which must match a given tag'sraw
content (the text as it appears in theroxygen2
header).