all_style {roger}R Documentation

Validation Using All Style Linters

Description

Check the style of code using all available linters.

Usage

all_style(srcData, include, exclude, ...)

Arguments

srcData

a list as returned by getSourceData.

include, exclude

character vector of linters to use or to omit, respectively. If both arguments are unspecified or NULL, all available linters are used.

...

further arguments passed to linters when appropriately named.

Details

The complete list of available style linters is as follows:

Value

A named list with the results of the linters.

Examples

## Keep parse data in non interactive sessions.
if (!interactive())
    op <- options(keep.source = TRUE)

fil <- tempfile(fileext = ".R")
cat("x <- c(2, 3, 5)", "crossprod(2,", "x)",
    "a <- array(1:24, 2:4)", "a[1, , ]",
    file = fil, sep = "\n")

all_style(getSourceData(fil))
all_style(getSourceData(fil), include = c("commas", "nomagic"))
all_style(getSourceData(fil), include = c("commas", "nomagic"),
          ignore.also = 5)
all_style(getSourceData(fil), exclude = "nomagic")

[Package roger version 1.5-1 Index]