-
Notifications
You must be signed in to change notification settings - Fork 3
cheats/rules: Refactor into partial object and set rules + Rename to newer terminology #9
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
21d8938
cheats/rules/partial: Refactor into partial object and set rules.
philipaconrad edf74c4
cheats/rules: Refactor naming to single/multi-value.
philipaconrad 96b3b6f
cheats/rules: Remove `import rego.v1` from examples.
philipaconrad 1830f4d
build: Regenerate the PDF.
philipaconrad 8543043
cheats/rules: Slight wording change for multi-value rules.
philipaconrad c0d9022
build: Regenerate PDF
philipaconrad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package cheat | ||
|
|
||
| import rego.v1 | ||
|
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] | ||
| } | ||
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
| 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. |
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
| 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 |
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
| 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" | ||
| ] | ||
| } |
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
| 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.
2 changes: 1 addition & 1 deletion
2
cheats/rules/partial/cheat.txt → cheats/rules/partial-set/cheat.txt
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
| 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. |
4 changes: 2 additions & 2 deletions
4
cheats/rules/partial/cheat.yaml → cheats/rules/partial-set/cheat.yaml
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
| 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.
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.
There was a problem hiding this comment.
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.