Skip to contents

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 or character regular expression that should be matched, or a list of either. See details for more information.

tag

A roxygen2::roxy_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 performed

  • check_linter(list): A list of functions or character 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`): A function to evaluate for the given tag

    function's are evaluated with the following arguments:

    1. The roxygen2::roxy_tag()

    2. 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 functions may print lint output, or signal lint output with messages or warnings. A cli::cli_alert() will reflect the severity of the function used to emit the output.

  • check_linter(character): A character regular expressions.

    If a character value is found, its value is assumed to be a regular expression which must match a given tag's raw content (the text as it appears in the roxygen2 header).