-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule: if-object-literal
#822
Labels
Comments
Here's how we can do it: add the new |
anderseknert
added a commit
that referenced
this issue
Jun 13, 2024
This replaces `if-empty-object`, and covers any object literal. Fixes #822 Signed-off-by: Anders Eknert <anders@styra.com>
Merged
anderseknert
added a commit
that referenced
this issue
Jun 13, 2024
This replaces `if-empty-object`, and covers any object literal. Fixes #822 Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert
added a commit
that referenced
this issue
Jun 13, 2024
srenatus
pushed a commit
to srenatus/regal
that referenced
this issue
Oct 1, 2024
This replaces `if-empty-object`, and covers any object literal. Fixes StyraInc#822 Signed-off-by: Anders Eknert <anders@styra.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Came across this old issue in the OPA backlog: open-policy-agent/opa#5294
And since that's unlikely to be fixed in OPA, we should at least make sure Regal flags it.
Note that we currently have the if-empty-object rule to cover the case OPA previously would fail for being an empty rule body.. but doesn't do anymore. While we could retrofit that rule to cover any object following an
if
, we'd have to do so much work around the docs, redirects and whatnot, that it's probably a better option to add a new rule that checks forif
followed by a non-empty object.Question is if there is ever a valid
if { ..object.. }
case? I can't think of one now, but happy to be proven wrong.The text was updated successfully, but these errors were encountered: