use_lintr: Add 'lintr' to R package

Description Usage Arguments Details Value Examples

Description

Add scaffolding for lintr package usage to R package.

Usage

1
use_lintr(base_path = ".", lint_as_test = FALSE)

Arguments

base_path

package root directory.

lint_as_test

logical, if TRUE (default), adds tests/testthat/test-lintr.R to package. See details.

Details

Note: This function is currently being reworked.

If lint_as_test = FALSE (default), a .lintr file is created in the package root directory. Set to TRUE if you intend to use lintr with unit testing so that problems caught by the linter cause test failure. Do not set to TRUE simply because you are using testthat, but apart from lintr.

When lint_as_test = TRUE, this function creates the template .lintr file in the inst directory and adds a symbolic link to this file in the package root directory. It also adds both files (as applicable) to .Rbuildignore. It also creates a unit test for lint-free package code only when lint_as_test = TRUE.

NOTE: You will have to run R as Administrator on Windows when lint_as_test = TRUE or the function will fail to create the symbolic link. Similar issues could present on other systems depending on user permissions.

Value

side effect of adding lintr scaffolding to package.

Examples

1
## Not run: use_lintr()

leonawicz/pkgpeanuts documentation built on June 7, 2019, 2:56 a.m.