validate
validate copied to clipboard
Should validate warn when a rule is an `&` of two rules?
validator
captures a set of rules that all must be obeyed for a record/dataset to be valid.
So implicitly all rules are AND
/ &
-ed.
When a rule consist of the &
of two rules, it can / should be split in two separate validation rules: both are to be enforced on their own.
e.g.
# one rule
rules <- validator( age >= 0 & income >= 0 )
# equivalent but better because they really are separate rules.
rules <- validator(
age >= 0
, income >= 0
)
Should validator
generate a warning when it encounters a &
rule?