mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
071f4ea99b
* Update Regal documentation Sync documentation with upstream Regal repository to reflect latest changes. This addresses a number of broken link issues from the checker before. Signed-off-by: Charlie Egan <charlie_egan@apple.com> * docs: Update release links these links create some issues in the link checker report. https://github.com/open-policy-agent/opa/issues/8278 ``` Errors in ./docs/docs/deploy/aws/ec2.mdx [404] https://github.com/open-policy-agent/opa/releases/download/v%7B%7Bversion%7D%7D/opa_linux_amd64 | Rejected status code (this depends on your "accept" configuration): Not Found Errors in ./docs/docs/deploy/azure/vm.mdx [404] https://github.com/open-policy-agent/opa/releases/download/v%7B%7Bversion%7D%7D/opa_linux_amd64 | Error (cached) Errors in ./docs/docs/deploy/google-cloud/gce.mdx [404] https://github.com/open-policy-agent/opa/releases/download/v%7B%7Bversion%7D%7D/opa_linux_amd64 | Error (cached) ``` These are not actually broken, they are just untemplated when the checker sees them. I figured since they are long lines we can use use a $REPO variable instead, to ensure that we only have valid https:// starting links on those pages. Signed-off-by: Charlie Egan <charlie_egan@apple.com> * Remove broken blog link https://github.com/open-policy-agent/opa/issues/8278 this link appears to be gone with no redirect. Signed-off-by: Charlie Egan <charlie_egan@apple.com> * docs: Fix outdated and broken documentation URLs Update various documentation links, SlideShare links, and external references that were resulting in redirects. Fixes https://github.com/open-policy-agent/opa/issues/8278 Signed-off-by: Charlie Egan <charlie_egan@apple.com> * Update broken regal links The other rules are using abs links here. Signed-off-by: Charlie Egan <charlie_egan@apple.com> --------- Signed-off-by: Charlie Egan <charlie_egan@apple.com>
1.2 KiB
1.2 KiB
messy-rule
Summary: Messy incremental rule
Category: Style
Avoid
package policy
allow if something
unrelated_rule if { # <--- this rule is breaking up allow
# ...
}
allow if something_else # <--- should be with the first allow
Prefer
package policy
allow if something
allow if something_else
unrelated_rule if {
# ...
}
Rationale
In Rego, rules can can be formed of many 'rule heads', partial definitions covering specific cases which together make up the behaviour of the whole rule. Rules that are defined incrementally should have their definitions grouped together, as this makes the code easier to follow. While this is mostly a style preference, having incremental rules grouped also allows editors like VS Code to "know" that the rules belong together, allowing them to be smarter when displaying the symbols of a workspace.
Configuration Options
This linter rule provides the following configuration options:
rules:
style:
messy-rule:
# one of "error", "warning", "ignore"
level: error
Related Resources
- GitHub: Source Code