Adds a statci_rule created with new_stat_rule() to the active statci
rule registry so that subsequent calls to stat_lint() and
stat_lint_dir() include it automatically.
Arguments
- rule
A
statci_ruleobject created bynew_stat_rule().- overwrite
Logical; if
TRUE, allows replacing an existing rule with the sameid.
Examples
r <- new_stat_rule(
id = "demo_rule",
title = "Demo rule",
severity = "info",
check = function(ctx) list()
)
register_stat_rule(r)
"demo_rule" %in% list_stat_rules()$id
#> [1] TRUE
unregister_stat_rule("demo_rule")
