linters_with_tags {lintr} | R Documentation |
Create a tag-based linter configuration
Description
Make a new list based on all linters provided by packages
and tagged with tags
.
The result of this function is meant to be passed to the linters
argument of lint()
,
or to be put in your configuration file.
Usage
linters_with_tags(tags, ..., packages = "lintr", exclude_tags = "deprecated")
Arguments
tags |
Optional character vector of tags to search. Only linters with at least one matching tag will be
returned. If |
... |
Arguments of elements to change. If unnamed, the argument is automatically named.
If the named argument already exists in the list of linters, it is replaced by the new element.
If it does not exist, it is added. If the value is |
packages |
A character vector of packages to search for linters. |
exclude_tags |
Tags to exclude from the results. Linters with at least one matching tag will not be returned.
If |
Value
A modified list of linters.
See Also
-
linters_with_defaults for basing off lintr's set of default linters.
-
all_linters for basing off all available linters in lintr.
-
available_linters to get a data frame of available linters.
-
linters for a complete list of linters available in lintr.
Examples
# `linters_with_defaults()` and `linters_with_tags("default")` are the same:
all.equal(linters_with_defaults(), linters_with_tags("default"))
# Get all linters useful for package development
linters <- linters_with_tags(tags = c("package_development", "style"))
names(linters)
# Get all linters tagged as "default" from lintr and mypkg
if (FALSE) {
linters_with_tags("default", packages = c("lintr", "mypkg"))
}