Skip to contents

Decides whether a fail_policy() is triggered by a result, for building custom gates (the CLI, knit gate, and GitHub Action use it).

Usage

evaluate_policy(res, policy, n_errors = 0L)

Arguments

res

A retraction_result.

policy

A fail_policy().

n_errors

Count of files that errored during the scan.

Value

A list: fail (logical), triggered (character reasons), counts (the per-state counts), and n_errors.

Examples

# \donttest{
res <- check_dois("10.1016/S0140-6736(97)11096-0")
evaluate_policy(res, fail_policy("flagged"))$fail
#> [1] TRUE
# }