Skip to content

Update dependency StyraInc/regal to v0.40.0#482

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/styrainc-regal-0.x
Open

Update dependency StyraInc/regal to v0.40.0#482
renovate[bot] wants to merge 1 commit intomainfrom
renovate/styrainc-regal-0.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Apr 27, 2026

This PR contains the following updates:

Package Update Change
StyraInc/regal minor v0.39.0v0.40.0

Release Notes

StyraInc/regal (StyraInc/regal)

v0.40.0

Compare Source

Today we celebrate Regal who turns v0.40.0 just in time for the GitHub download tracker to report 1 million total downloads. Quite the milestone! Thank you all for the encouragement, support and contributions during these past 3 years. Together we're redefining the policy development experience, and we have a lot more of that planned for the future. Stay tuned!

This release includes 2 new linter rules, and many new features and improvements to both the linter and language server.

Linter
New Rule: invalid-regexp

Category: bugs

The new invalid-regexp rule scans regular expressions found in policies and reports invalid patterns that would otherwise fail at runtime.

Avoid

package policy

invalid if regexp.match("[a-z", "test")

Prefer

package policy

valid if regexp.match("[a-z]", "test")
New Rule: superfluous-object-get

Category: idiomatic

The superfluous-object-get rule flags calls to object.get where using the built-in function provides no benefit compared to using a reference directly, and without the call.

Avoid

package policy

superfluous if {
    # the default value (`""`) isn't used in the expression,
    # so object.get provides no benefit here
    object.get(input, ["user", "department"], "") == "engineering"
}

Prefer

package policy

much_better if {
    input.user.department == "engineering"
}

More cases of superfluous object.get will be added to this rule as we encounter them.

Improvements
  • The naming-convention rule now accepts a list of allowed names in addition to regex patterns
  • The non-loop-expression rule now identifies more types of expressions that could be moved out of iteration
  • All rules now contain a related_resources item in their metadata pointing to the docs for the rule
  • The regal new rule command now generates a Related Resources section in the new rule's documentation template
    (thanks @​mvanhorn!)
Bugs Fixed
  • Fixed two false positives reported in the non-loop-expression rule
  • The server now exits with an error if the --profile flag is used without --format json (thanks @​mvanhorn!)
Language Server
Evaluate and Debug Actions

Any input.json or input.yaml file found in the workspace will be used for input during evaluation and debugging sessions, but this wasn't obvious without reading the docs. The Evaluate and Debug code lenses / commands will now present a dialog option asking to create an input.json file in the project workspace in case one isn't found. This file is populated with dummy JSON data based on references to input found in the policy, and should be edited by the user to provide more relevant data.

Many thanks to @​SeanLedford for this great work!

Hover Provider Improvements

The hover provider showing tooltips for built-in functions and keywords has been rewritten in Rego, and additionally saw a few improvements land as part of that process:

  • Links to examples for built-in functions now point to the correct location in the OPA docs
  • The print function now shows up in hover results as well
  • Hover provider now less resource intensive, and all information rendered just in time for display
Inlay Hints Improvements

The inlay hint provider (that provides names of function arguments to be displayed at call sites) has also been rewritten in Rego, and the server now implements also the inlayHint/resolve handler, which improves performance by only calculating inlay hint details when the client requests them for display.

Additionally, the inlay hint provider now properly takes the range of the active editor view into account, and will only spend resources calculating hints for code that the user can actually can see.

Semantic Tokens in Comprehensions and every Expressions

The language server's semantic token provider (providing context-based syntax highlighting) now provides semantic tokens inside of comprehensions and every expressions in addition to previously supported contexts. Additionally, most of the semantic token logic is now implemented entirely in Rego.

Improved Language Server Initialization

This release contains a number of fixes and improvements related to the language server's initialization routine, which should now be both more robust and faster.

Bugs Fixed
  • Two potential nil dereferences identified and fixed
  • Fix a potential out of bounds panic in slice access
  • The bundled web server now shows a link to Regal's editor integration documentation on its index page
Finally

Extra thanks goes out to @​charlieegan3 this release, who worked tirelessly to fix some really complex race conditions and concurrency issues in the language server. A thankless job, but extremely important, and he pulled it off like a true Viking!

Changelog

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, only on Monday (* 0-3 * * 1)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot requested a review from a team as a code owner April 27, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants