check_template: Check the structure of a templated project

View source: R/check_template.R

check_templateR Documentation

Check the structure of a templated project

Description

Check if the parts of a template are in place, based on the template's spec.

Usage

check_template(template, name = "", dir = ".", spec = NULL)

Arguments

template

Name of the template (e.g., "function").

name

Name of the template instance (e.g., "test_function").

dir

Path to the base directory of the template.

spec

The template's spec; specify if template spec files do not exist.

Value

A list with results of the check:

dir Path of the checked directory.
files Path(s) of the checked files.
spec A list with the template's spec.
status A named logical vector indicating whether each components exist.
incomplete A character vector with any existing files that still have template text.
exists all(status)
message A character vector including messages associated with failures.

Examples

## Not run: 
# precheck before a new template is made
check_template("template_new", list(name = "new", context = "new", files = list("new.R")))

# check the new template after creation
check_template("new")

## End(Not run)

uva-bi-sdad/community documentation built on Oct. 12, 2023, 1:18 p.m.