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

lint_dir

Lint a directory


Description

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

Usage

lint_dir(
  path = ".",
  relative_path = TRUE,
  ...,
  exclusions = NULL,
  pattern = rex::rex(".", one_of("Rr"), end),
  parse_settings = TRUE
)

Arguments

path

the path to the base directory, by default, 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.

pattern

pattern for files, by default it will take files with .R or .r extension.

parse_settings

whether to try and parse the settings

Value

A list of lint objects.

Examples

## Not run: 
  lint_dir()
  lint_dir(
    linters = list(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.