check_package: Check a Package

Description Usage Arguments Details Value See Also Examples

View source: R/wrappers.R

Description

Run check_file on a package's source.

Usage

1
check_package(path, pattern = "\\.[rR]$", ...)

Arguments

path

Path to the package to be checked.

pattern

A pattern to search files with, see list.files.

...

Arguments to be passed to check_file.

Details

The function catches the messages of "cleanr"-conditions thrown by check_file and, if it caught any, throws them.

Value

Invisibly TRUE, but see Details.

See Also

Other wrappers: check_directory(), check_file_layout(), check_file(), check_function_layout(), check_functions_in_file()

Examples

1
2
3
4
5
6
7
8
9
# create a fake package first:
package_path <- file.path(tempdir(), "fake")
usethis::create_package(package_path, fields = NULL,
                        rstudio = FALSE, open = FALSE)
directory <- system.file("runit_tests", "source", "R_s4",
                         package = "cleanr")
file.copy(list.files(directory, full.names = TRUE), file.path(package_path,
                                                              "R"))
RUnit::checkTrue(cleanr::check_package(package_path, check_return = FALSE))

cleanr documentation built on Nov. 14, 2021, 9:07 a.m.