Allow `not every`
I know there are reasons why we currently don't, and that there are other ways to achieve the same outcome, but for someone not deeply familiar with Rego, it might not be obvious how to get there. Additionally, and certainly not to be dismissed, not every reads rather nicely compared to many of the alternatives.
report contains "missing important attribute" if {
not every resource in list {
resource.important_attribute
}
}As a "good enough" solution if we intend to keep the current behavior, we can improve the error message, and rather than to say:
unexpected every keyword: illegal negation of 'every'We point the user to documentation where we explain why it can't be expressed that way, and what they should use instead.
A side note really, but a pretty nice side-effect of allowing this is how every provides a body of its own, and can be used even with "single-line" rules, which would allow the example above to be written as:
report contains "missing important attribute" if not every resource in list {
resource.important_attribute
}Source: open-policy-agent/opa