v0.6.0
This release brings a new command for quickly generating new (custom or built-in) rules, a new linter rule, and some improvements around tooling.
New command to help develop new rules
The regal new rule
command may now be used to quickly get started developing your own rules, wether custom ones for your organization, or built-in rules for inclusion in Regal.
regal new rule --category naming --name foo-bar-baz
The above command will create two new files under .regal/rules/naming
(all directories created if not exists since before) where one is a policy for the new rule, and another is a test for the same rule. See the updated documentation for custom rules development for more details.
New rule: non-raw-regex-pattern
Using raw string literals for regex pattern has since long been a best practice, and is recommended both by the OPA docs as well as the Rego Style Guide.. The new non-raw-regex-pattern
rule (in the idiomatic
category) will now help enforce this convention.
Pre-Commit Hooks
Regal now provides pre-commit hooks for easily running Regal as part of your development workflow. Very useful if you want to ensure regal lint
is run before you commit any changes to policy files. See the docs on pre-commit hooks for more information. Thanks @adam-moss and @c-wygoda for your contributions to this feature.
Other notable changes
- The
use-in-operator
rule has been moved from thestyle
category toidiomatic
. Thanks @Parsifal-M! - The documentation for all rules now includes a footer linking to the Regal channel in the Styra Community Slack.
- OPA version bumped from v0.54.0 to v0.55.0
Changelog
- 3b80295: Move use-in-operator to idiomatic category (@Parsifal-M)
- 60cffc3: Bump github.com/open-policy-agent/opa from 0.54.0 to 0.55.0 (#217) (@dependabot[bot])
- 52e8d5d: Some minor fixes (#218) (@anderseknert)
- f2ddc4e: feat: add pre-commit hook (#221) (@adam-moss)
- 9499689: Add self-downloading pre-commit hook (#226) (@c-wygoda)
- 520d67d: Move pre-commit docs to separate page (#227) (@anderseknert)
- 5020e41: Add community footer to docs pages (#228) (@anderseknert)
- c210d80: Rule: non-raw-regex-pattern (#225) (@anderseknert)
- 44cd7de: Scaffolding (#219) (@anderseknert)