Skip to content

v0.9.0

Compare
Choose a tag to compare
@github-actions github-actions released this 19 Sep 11:04
· 698 commits to main since this release
83f22ee

This release brings three new rules to Regal, a new Rego-based build system, and improvements to the Go API. Plus a number of improvements, features and bugfixes.

The v0.9.0 release also coincides with some exciting news from our community — users of the Rego Playground now experience Regal integrated in the tool, and have linter violations reported directly in the UI!

New rule: dubious-print-sprintf

Category: testing

This new rule will flag the use of print together with sprintf in it's argument list. The print function takes any number of arguments as it is, and using sprintf negates the benefits of the print functions special handling of undefined values.

For more information, see the docs on dubious-print-sprintf.

Thank you @Ronnie-personal for contributing this rule! 👏

New rule: forbidden-function-call

Category: custom

In the custom category, the new forbidden-function-call rule will allow you to configure a list of built-in functions that should be flagged by Regal if encountered. This could for example be http.send calls, or JWT decoding using HMAC rather than assymetric crypto.

For more information, see the docs on forbidden-function-call.

New rule: chained-rule-body

Category: style

The new chained-rule-body rule will have Regal flag rules where the body is "chained", as this style isn't recommended any more.

For more information, see the docs on chained-rule-body.

Regal in the Rego Playground!

Regal is now integrated in the Rego Playground, and provides users with information on linter violations as they work on their policies!

Thanks @charlieegan3 for your work on this!

Go API (experimental)

While integrations using the Go API is still not recommended, several steps were taken in this release in order to move it closer to a stable state. This work was done in order to get Regal integrated into the Rego Playground.

Documentation

A new page on the Regal's architecture has been added to the docs, which should be helpful for people looking to contribute to Regal, or those curious to learn more about how Regal works.

Using Rego to build Rego that lints Rego!

Regal now uses Rego — via @charlesdaniels eminent rq tool — as a "build tool" of sorts. See this LinkedIn post for more details, and a link to our new build definition file. The development docs have been updated with instructions for using this tool.

While we're on that topic — the new do.rq pr task will run all the formatting, testing and linter steps required to prepare a PR. Make sure to use it when contributing!

Thanks to @srenatus for leading the way on this one!

Other improvements and fixes

  • Custom configuration for a rule is no longer required to provide a level attribute. If not provided, the level will be inherited from the default configuration for that rule.
  • The walk built-in function is now by default excepted by the function-arg-return rule. See the rule documentation for details.
  • The regal lint command now accepts a --metrics flag, which will provide helpful information on where Regal spends most of the time evaluating a project.

Credits

Thank you all who contributed to this release! Special thanks goes out to first time contributors:

You rock! 👏

Changelog