v0.7.0
This release adds a new custom
category to the built-in rules, which allows users to easily define the most common organizational requirements, like naming conventions, by simply editing their Regal configuration. This release also brings a new frontend for the Regal docs, which are now published to docs.styra.com/regal.
New custom category, and naming-convention
rule
The custom category of rules allows teams and organizations to define their own conventions for their Rego projects, without having to write custom linter policies. Naming conventions are likely the most common requirement, which is also what the new naming-convention rule helps solve by allowing users to specify their conventions in the Regal configuration using regex patterns.
An example configuration leveraging the naming-convention rule could look like below:
rules:
custom:
naming-convention:
# one of "error", "warning", "ignore"
level: error
conventions:
# allow only "private" rules and functions, i.e. those starting with
# underscore, or rules named "deny" or "allow"
- pattern: '^_[a-z]+$|^deny$|^allow$'
# one of "package", "rule", "function", "variable"
targets:
- rule
- function
# any number of naming rules may be added
# package names must start with "acmecorp" or "system"
- pattern: '^acmecorp|^system'
targets:
- package
Note that all rules in the "custom" category are disabled by default (i.e. level "ignore") as some configuration needs to be provided by the user (i.e. you!) in order for them to be useful.
Docs published to docs.styra.com
While GitHub renders markdown well, the file browser doesn't lend itself too well for exploring all the rules available in Regal. From this release, docs are now published to to docs.styra.com/regal, and this page will be used in links found in the reports emitted by regal lint
. If you prefer navigating GitHub, the markdown files are still there too.
Changelog
- 9c1f17c: Run GitHub Actions workflow only once (#232) (@iamleot)
- 78a9f17: Fix broken non-anchor link (#233) (@charlieegan3)
- 2f8e715: Add custom category and rule for naming conventions (#235) (@anderseknert)
- c0fa3db: Use H1 for pre-commit hook title (#237) (@charlieegan3)
- b5730ae: [docs] Fix typo in slack links (#238) (@charlieegan3)
- cd385bd: Use absolute links for images (#240) (@charlieegan3)
- 222fbe5: Update roadmap status (#241) (@anderseknert)
- 565150f: Use abs link for config file link (#242) (@charlieegan3)
- 258b8b6: Move "Exceptions" to after "Rationale" (#245) (@anderseknert)
- 99205f8: Add .gitattributes for proper language detection (#246) (@anderseknert)
- 031d292: Remove build.sh script (#247) (@anderseknert)
- 6f91381: Use docs.styra.com for published docs (#249) (@anderseknert)