Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lint_package

Lint a package


Description

Apply one or more linters to all of the R files in a package.

Usage

lint_package(
  path = ".",
  relative_path = TRUE,
  ...,
  exclusions = list("R/RcppExports.R")
)

Arguments

path

the path to the base directory of the package, if NULL, it will be searched in the parent directories of the current directory.

relative_path

if TRUE, file paths are printed using their path relative to the base directory. If FALSE, use the full absolute path.

...

additional arguments passed to lint, e.g. cache or linters.

exclusions

exclusions for exclude, relative to the package path.

Value

A list of lint objects.

Examples

## Not run: 
  lint_package()

  lint_package(
    linters = with_defaults(semicolon_linter = semicolon_terminator_linter())
    cache = TRUE,
    exclusions = list("inst/doc/creating_linters.R" = 1, "inst/example/bad.R")
  )

## End(Not run)

lintr

A 'Linter' for R Code

v2.0.1
MIT + file LICENSE
Authors
Jim Hester [aut, cre], Florent Angly [aut], Russ Hyde [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.