Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 42 additions & 4 deletions build/cheatsheet.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/cheatsheet.pdf
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generated PDF looks a bit wonky but we can come back to that once this is in.

Binary file not shown.
40 changes: 38 additions & 2 deletions build/cheatsheet.tex

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions cheats/rules/partial-object/cheat.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package cheat

import rego.v1
Comment thread
philipaconrad marked this conversation as resolved.
Outdated

# Creates an object with sets as the values.
paths_by_prefix[prefix] contains path if {
some path in input.paths
parts := split(path, "/")
prefix := parts[0]
}
1 change: 1 addition & 0 deletions cheats/rules/partial-object/cheat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Partial object rules generate and assign a set of keys and values to a variable.
3 changes: 3 additions & 0 deletions cheats/rules/partial-object/cheat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: Partial Object Rules
rank: 3
link: https://www.openpolicyagent.org/docs/latest/#partial-rules-objects
9 changes: 9 additions & 0 deletions cheats/rules/partial-object/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"paths": [
"a/123.txt",
"a/456.txt",
"b/foo.txt",
"b/bar.txt",
"c/x.txt"
]
}
7 changes: 7 additions & 0 deletions cheats/rules/partial-object/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"paths_by_prefix": {
"a": ["a/123.txt", "a/456.txt"],
"b": ["b/bar.txt", "b/foo.txt"],
"c": ["c/x.txt"]
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Partial rules generate and assign a set of values to a variable.
Partial rules generate and assign a set of values to a variable.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
title: Partial Rules
title: Partial Set Rules
rank: 2
link: https://www.openpolicyagent.org/docs/latest/#partial-rules
link: https://www.openpolicyagent.org/docs/latest/#partial-rules-sets
File renamed without changes.
File renamed without changes.