2023-10-03 22:27:11 by Leonardo Taccari | Files touched by this commit (3) |
Log message:
regal: Update to 0.10.0
Changes:
0.10.0
------
This release brings a new type of linter rule to Regal - aggregate
rules. v0.10.0 also brings a number of new rules, new features,
performance improvements and bug fixes.
## New rules
- `prefer-package-imports` (Category: `imports`)
- `no-defined-entrypoint` (Category: `idiomatic`)
- `default-over-else` (Category: `style`)
- `rule-length` (Category: `style`)
## Features and improvements
- `regal lint --enable-print`: `regal lint` command now
accepts an `--enable-print` flag to simply allow `print` statements
without printing other debugging information.
- `regal lint --profile`: similarly to the profiling
capabilities in OPA, Regal now provides a `--profile` flag to help
collect and report profiling data, helping policy authors and Regal
developers to see where most of the time is spent in evaluation.
- Performance improvements
## Other improvements
- The `regal new rule` command now adds both a documentation page and
an entry in the README table.
- A `non-breakable-word-threshold` option has been added to the
`line-length` rule, which allows tolerating single words that exceed
the line length if they can't be broken up into several parts, like
URLs.
- The `top-level-iteration` incorrectly identified constants and other
parameters as iteration.
|
2023-09-19 20:50:40 by Leonardo Taccari | Files touched by this commit (3) |
Log message:
regal: Update to 0.9.0
Changes:
0.9.0
-----
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.
## 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.
## 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.
## 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.
## 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.
- 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.
|
2023-09-08 21:06:15 by Benny Siegert | Files touched by this commit (154) | |
Log message:
Revbump all Go packages after go120 update
|
2023-09-06 11:42:55 by Leonardo Taccari | Files touched by this commit (3) |
Log message:
regal: Update to 0.8.0
Changes:
v0.8.0
------
This is the most feature-packed release to date, adding a new output
format, four new rules, and many improvements across the board!
## New GitHub output format
The `regal lint` command now accepts a new `--format` option named
`github`. This is ideal for when Regal is run in CI/CD scenarios using
GitHub Actions. This format will emit annotations for any violation,
which will be visible in the pull request file view.
In addition to this, the GitHub output format will also create a linter
report visible in the "Checks" tab:
This report summarizes the result of linting, with links provided to
the documentation for any violation.
## New rule: use-some-for-output-vars
Using `some` to declare output variables used in iteration (and
elsewhere) has long been considered a best practice. Regal can now
identify places where variables are introduced without `some` and treat
these as errors.
## New rule: prefer-some-in-iteration
Similarly, the new `prefer-some-in-iteration` rule will have Regal warn
when using the "old" style of iteration which could be replaced in
favor of `some ... in`.
## New rule: metasyntactic-variable
Using rule and variable names like "foo", "bar" or \
"baz" might be
convenient in examples, but rarely has a place in production policy.
The new `metasyntactic-variable` rule will flag any occurences of these
names. The `ignore` directive may of course be used to e.g. allow these
type of variables in tests or other legitimate locations.
## New rule: file-length
Having policy files span several hundred lines of code is often a
signal to consider refactoring the code into smaller units, and to
modularize properly using packages and imports. The new `file-length`
rule by default flags any file with more than 500 lines. This number
can be changed via the rule's configuration.
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.
## 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.
|
2023-08-26 18:31:41 by Benny Siegert | Files touched by this commit (149) | |
Log message:
Revbump all Go packages after go120 update
|
2023-08-10 23:45:25 by Leonardo Taccari | Files touched by this commit (5) |
Log message:
regal: Import regal-0.6.0 as devel/regal
Regal is a linter for Rego, with the goal of making your Rego
magnificent!
Regal goals are:
- Identify common mistakes, bugs and inefficiencies in Rego policies,
and suggest better approaches
- Provide advice on best practices, coding style, and tooling
- Allow users, teams and organizations to enforce custom rules on their
policy code
Regal rules are to as large extent as possible written in Rego
themselves, using the JSON representation of the Rego abstract syntax
tree (AST) as input, a few additional custom built-in functions and
some indexed data structures to help with linting.
Packaged by myself in pkgsrc-wip.
|