Skip to contents

Impose ordering of validation child files

Remove validation file orderingfrom the projects validation config file

Add user information to the projects validation config file to make for easier documentation

Remove user information from the projects validation config file

Get recorded user information from the validation config file to make for easier documentation

Use a Validation Config File Validation configuration for working/output directories, validation report naming conventions, and tracking user information(username,name,title, role). Provides a single location for setting behaviors.

Capture the information on a user that is going to be involved with validation

Usage

vt_add_file_to_config(filename, before = NULL, after = NULL)

vt_drop_file_from_config(filename)

vt_add_user_to_config(username = whoami::username(), name, title, role)

vt_drop_user_from_config(username)

vt_get_user_info(username, type = c("name", "title", "role"))

vt_use_config(
  pkg = ".",
  package,
  working_dir,
  output_dir,
  report_rmd_name = "validation.Rmd",
  report_naming_format = "Validation_Report_{package}_v{version}_{date}",
  username_list = list(),
  validation_files = list(),
  ...,
  overwrite = FALSE
)

vt_user(username, name, title, role, ...)

Arguments

filename

character vector containing filenames in order

before, after

Optional destination of new filenames, default is end of existing list. Supports <tidy-select> functions. Specifying both is error.

username

username of the user.

name

full name of the user.

title

title of the user.

role

role of the user. Can be more than one.

type

type of information to pull. select at least one: name, title, role

pkg

where to write config file

package

character name of package or set validation is being performed for.

working_dir

character which directory to be have working validation contents that are used interactively

output_dir

character which folder should the contents for validation output to.

report_rmd_name

character name of rmarkdown document that is to be used for validation.

report_naming_format

character a glue friendly string of the naming structure of the output validation report. use {package} for package name, {version} to record package version, and {date} to capture the date the report was run.

username_list

list of user objects created by make_user. Each user contains entries for username, name, title, and role to be used for documentation.

validation_files

list of validation files: requirements, test cases and test code. Validation report content will be populated using this list in order.

...

additional information about the user to be passed into a list.

overwrite

[boolean]If a validation file exists, should it be overwritten? Defaults to FALSE.

Value

Used for side effect of adding validation file ordering to validation config file. Invisibly returns TRUE on success.

Used for side effect of removing file ordering information from validation config file. Invisibly returns TRUE on success.

Used for side effect of adding user information to validation config file. Invisibly returns TRUE on success.

Used for side effect of removing user information to validation config file. Invisibly returns TRUE on success.

a character vector length of types requested containing the user information from the validation config file.

Used for side effect to create validation config file. Invisibly returns TRUE on success.

a "user" object

Examples

if (FALSE) {

vt_use_validation()

vt_add_file_to_config(filename = "myReqFile.Rmd")
}
if (FALSE) {

vt_use_validation()

vt_add_file_to_config(filename = "myReqFile.Rmd")

vt_drop_file_from_config(filename = "myReqFile.Rmd")

}
if (FALSE) {

vt_use_validation()

vt_add_user_to_config(
    username = "ellis",
    name = "Ellis Hughes",
    title = "Statistical Programmer",
    role = "Programmer")

}
if (FALSE) {

vt_use_validation()

vt_add_user_to_config(
    username = "ellis",
    name = "Ellis Hughes",
    title = "Statistical Programmer",
    role = "Programmer")

vt_drop_user_from_config(username = "ellis")

}
if (FALSE) {

vt_use_validation()

vt_add_user_to_config(
    username = "ellis",
    name = "Ellis Hughes",
    title = "Statistical Programmer",
    role = "Programmer")

vt_get_user_info(username = "ellis", type = c("name","title"))

}

withr::with_tempdir({
vt_use_validation(
              package = "test.package",
              working_dir = ".",
              output_dir  = ".",
              report_naming_format = "Validation_Report_{package}_v{version}_{date}",
              username_list = list(
                 vt_user(
                       name = "test",
                       title = "test",
                       role = "tester",
                       username = "test"
                       )))
 })
#>  Adding '!*' to '././validation/.gitignore'
#> Created ./validation  in package structure
#> validation config file created. Add user information through `vt_add_user_to_config()`


vt_user(
    username = "ellis",
    name = "Ellis Hughes",
    title = "Statistical Programmer",
    role = "Programmer")
#> $ellis
#> $ellis$name
#> [1] "Ellis Hughes"
#> 
#> $ellis$title
#> [1] "Statistical Programmer"
#> 
#> $ellis$role
#> [1] "Programmer"
#> 
#> 
#> attr(,"class")
#> [1] "vt_user" "list"