Skip to content

v0.7.0

Compare
Choose a tag to compare
@github-actions github-actions released this 11 Aug 08:54
· 747 commits to main since this release
6f91381

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