Skip to contents

Ensures project names are valid character strings containing only lowercase letters, numbers, underscores, hyphens, or dots, and have at least two characters. Optionally allows multiple names (via single = FALSE) and NULL values (via alt_null = TRUE).

Usage

dl_check_project(project, single = TRUE, alt_null = FALSE, verbose = FALSE)

Arguments

project

Character scalar or vector defining the project name(s). Allowed characters: lowercase letters, numbers, _, -, and ..

single

Logical. If TRUE, only a single project name is allowed. If FALSE, a vector of project names is accepted. Default is TRUE.

alt_null

Logical. If TRUE, allows NULL as a valid input. Default is FALSE.

verbose

Logical. If TRUE, prints validation messages. Default is FALSE.

Value

Invisibly returns the validated project name(s).

Examples

dl_check_project("bastion")
dl_check_project("test-project", verbose = TRUE)
#> ✔ Validated 1 project name(s): "test-project".
dl_check_project(NULL, alt_null = TRUE)
dl_check_project(c("proj_a", "proj_b"), single = FALSE)