Add use-array-flatten and use-object-union-n rules#1873
Merged
anderseknert merged 1 commit intoopen-policy-agent:mainfrom Feb 16, 2026
Merged
Add use-array-flatten and use-object-union-n rules#1873anderseknert merged 1 commit intoopen-policy-agent:mainfrom
use-array-flatten and use-object-union-n rules#1873anderseknert merged 1 commit intoopen-policy-agent:mainfrom
Conversation
charlieegan3
approved these changes
Feb 16, 2026
|
|
||
| location := util.to_location_object(value.terms.location) | ||
| keywords := array.concat([{"name": "some", "location": location}], _in_on_row(location.row)) | ||
| keywords := array.flatten([{"name": "some", "location": location}, _in_on_row(location.row)]) |
|
|
||
| some call in wrapped_concat_calls | ||
|
|
||
| violation := json.patch(result.fail(rego.metadata.chain(), result.location(call)), [{ |
Contributor
There was a problem hiding this comment.
We do this in naming_convention.rego too with a hhelper _with_description(violation, description). Which these, that makes three rules now. Might it be useful in other rules, or in new rules that need to have the desc configured.
Member
Author
There was a problem hiding this comment.
Oh, I didn't realize. That's a good call, yes! Will update in the next PR (have code lined up already :))
With a few config knobs for the config inclined. Fixes open-policy-agent#1855 Signed-off-by: Anders Eknert <anders.eknert@apple.com>
4e7dd40 to
e93e490
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a few config knobs for the config inclined.
Fixes #1855