Skip to contents

compose_rules() joins registries, each a named list of rule() entries. An entry of a later registry replaces the entry of the same name of an earlier registry.

Usage

compose_rules(...)

Arguments

...

Registries: named lists of rule() entries.

Value

A named list of rule() entries.

Details

The result holds each name once, in the order in which the names first appear. Use compose_rules(), not c(): c() keeps both entries of a name, and [[ then returns the first.

Examples

pass <- function(path, files) {
  return(data.frame(
    rule = character(0),
    status = character(0),
    path = character(0),
    detail = character(0)
  ))
}
old <- checkit::rule(pass, "the old text", "fix it")
new <- checkit::rule(pass, "the new text", "fix it")
both <- checkit::compose_rules(list(a = old), list(a = new))
both[["a"]]$pass_detail
#> [1] "the new text"