Update dependency regal to v0.38.1 (main) #3926
Open
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.36.1->0.38.1Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
StyraInc/regal (regal)
v0.38.1This patch release fixes several bugs including some found in the recent v0.38.0 release, as well some other improvements.
Bug Fixes
prefer-equals-comparisonfixer failing to parse policies with multiple "=" in expressions (#1824, fixes #1818 reported by @gusega)prefer-equals-comparisonrule with comprehension term vars (#1828, fixes #1826 reported by @SeanLedford)Improvements
prefer-equals-comparisonfixer now available in the language server (#1810)prefer-value-in-headrule to count interpolated strings as scalars (#1817)any_set_item, used for selecting items from sets (#1815)Changelog
f1c5f74: bundle: Improve performance of any_set_item (#1815) (@charlieegan3)9300420: Implemented Code action for prefer-equals-comparison fixer (#1810) (@SeanLedford)28121f0: build(deps): bump github/codeql-action in the dependencies group (#1823) (@dependabot[bot])54cdcb6: Addprefer-value-in-headoption to count interpolated string as scalar (#1817) (@anderseknert)e68184d: Fix false positivie in prefer-equals-comparison (#1828) (@anderseknert)593e221: fix: Prefer-Equals-Comparison Edge Case With Multiple "=" (#1824) (@SeanLedford)3dc28bb: bundle: Surface configured rule notices (#1827) (@charlieegan3)aac9618: Updated lint reporter to track fixable violation count separate from fixable violation Set (#1825) (@SeanLedford)fd6dd4d: Updated example for prefer-equals-comparison edge case to not include false positive (#1829) (@SeanLedford)v0.38.0Happy New Year from the Regal maintainers!
Feature: String Interpolation Support
v0.38.0 of your favorite Rego linter, debugger and language server brings full support for OPA's new string interpolation feature. This means not only that Regal lints code found inside interpolated strings, but that you'll have access to all your favorite language server features within them too — like code completions, tooltips on hover, or document highlighting. You can even use the debugger to step through interpolated expressions! If you haven't yet tried it out, grab OPA v1.12.2, Regal v0.38.0 and enjoy an absolutely awesome addition to the Rego language!
In addition to this, we have a number of fun new features and performance improvements.
New Rule:
disallow-rego-v1Category:
customThis optional new rule flags the use of import rego.v1 in Rego policies (#1778). Since OPA v1.0 (December 2024), this import is a no-op and no longer needed. The rule helps users maintain clean code by preventing this outdated import from appearing in new policies. Teams standardizing on OPA 1.0+ can enable this rule to enforce modern Rego standards.
Authored by @SeanLedford.
New Fixers
@SeanLedford has also done some great work to help expand Regal's auto-fixing capabilities by having
regal fixers added for three more rules.See (#1790) and (#1794) for more details.
Performance
The fixer saw a 12% performance improvement by reusing the linter, reducing allocations from 2.3M to 2.0M operations (#1783). Additional optimizations include:
To track ongoing performance work, a new post-merge benchmark-recording workflow was added (#1793).
LSP: New Ignore Code Action
The language server now supports a code action to quickly add regal ignore configuration for specific rules directly from the editor (#1777).
Changelog
ac35695: Various performance improvements (#1758) (@anderseknert)48cd03d: docs: Add custom head for regal index page (#1761) (@charlieegan3)728ae28: build(deps): bump golangci/golangci-lint-action (#1762) (@dependabot[bot])92cf6ca: explorer: allow hiding stages without an effect (+misc) (#1760) (@srenatus)c000994: docs: Correct sidebar labels (#1763) (@charlieegan3)bf0b621: build(deps): bump github.com/containerd/containerd/v2 in /e2e/testbuild (#1753) (@dependabot[bot])18e7a89: build(deps): bump github.com/containerd/containerd/v2 (#1754) (@dependabot[bot])ccab7bd: Rename: encoding/util -> encoding/write (#1764) (@anderseknert)54f7625: build: run windows in matrix with other jobs (#1770) (@charlieegan3)5c9e6f0: update: Update version checking logic (#1772) (@charlieegan3)5034776: build: Add badge update to readme script (#1773) (@charlieegan3)95e8220: Added OPA installation as a Regal prerequisite, and fixed golangci-lint link. (#1774) (@SeanLedford)149f71d: build(deps): bump js-yaml from 4.1.0 to 4.1.1 in /build (#1775) (@dependabot[bot])b8f8b7f: Enable more golangci-lint linters (@anderseknert)e092627: build: Update mac runner (@charlieegan3)877884c: lsp: Add code action and command to ignore rule (#1777) (@charlieegan3)ece9ca2: build(deps): bump the dependencies group with 5 updates (@dependabot[bot])bd37bbd: build(deps): bump golang.org/x/crypto in /build/lsp (@dependabot[bot])17cc429: build(deps): bump golang.org/x/crypto in /e2e/testbuild (@dependabot[bot])415b05f: build(deps): bump golang.org/x/crypto from 0.43.0 to 0.45.0 (@dependabot[bot])e1bb975: Improve fixer performance (@anderseknert)1b083ff: Added Rule: Disallow import rego.v1 (#1778) (@SeanLedford)9e43c50: Optimize and improve code for built-in functions (@anderseknert)64ce2aa: build(deps): bump glob and markdownlint-cli in /build (#1779) (@dependabot[bot])48fddeb: build(deps): bump github/codeql-action in the dependencies group (#1787) (@dependabot[bot])bc41f63: pkg/linter: use errgroup, set limits + context on it (@srenatus)f22c2aa: Add fixer for prefer-equals-comparison rule (#1790) (@SeanLedford)cf88eb9: Fixers for redundant-existence-check and constant-condition rules (#1794) (@SeanLedford)36401a2: build(deps): bump the dependencies group across 1 directory with 7 updates (#1796) (@dependabot[bot])ecb23d3: version: Add OPA version to version output (#1798) (@charlieegan3)94ce038: build(deps): bump golang.org/x/crypto from 0.43.0 to 0.45.0 in /build/ws (#1791) (@dependabot[bot])9ce1ddd: workflows: add post-merge benchmark-recording workflow (@srenatus)e111443: workflows/benchmark: fix golang setup (@srenatus)4bb2d5a: docs: Update messy rule docs (@charlieegan3)dec83ea: docs: Updates from opa website link scanner (@charlieegan3)8f544a6: fix typo in fix.go help message (#1807) (@gusega)941b02e: build(deps): bump the dependencies group with 3 updates (#1804) (@dependabot[bot])9f09e6e: build(deps): bump the dependencies group with 4 updates (#1808) (@dependabot[bot])476ef89: OPA v1.12.2 and full string interpolation support (#1811) (@anderseknert)a9843ab: Movechained-rule-bodytocustomcategory (#1812) (@anderseknert)v0.37.0Regal v0.37.0
This release features a new linter rule, several new language server features, and many improvements and fixes. The two major OPA versions bumped since the last release additionally contains several performance improvements that were contributed as part of developing Regal!
New Rule:
prefer-equals-comparisonThe prefer-equals-comparison linter rule recommends using the
==operator for equality comparison over the unification operator=. The rule helps improve code clarity by using operators for their intended purposes::=for assignment,==for equality comparison, and=for unification. The linter identifies when=is used for comparison by checking if both sides of the operator are "unassignable".Avoid
Prefer
There are some certainly valid use cases for the unification operator! But simple equality comparison is not one. For more information, see the documentation for the rule. As an amusing aside, this fixes one of the first issues created in the project!
Language server: Document highlighting to help show where function args are referenced
Document highlighting is one of the more subtle features of the LSP specification, but a really helpful one when implemented well. The experimental first implementation that shipped with Regal v0.36.0 is no longer experimental, and has also been extended to highlight usage of function argument variables inside of a function head or body.
Language server: Selection ranges
Selection ranges provide smart selection of code that can expand and shrink based on knowledge of the code rather than simple text properties, like hyphens or whitespace. This makes moving code around extremely fast, and without leaving the keyboard. Consult the language server docs for how to enable this in your editor
Improvements
everystatements, and so on.Windows compatibility improvements
In this release we have fixed various Windows bugs (Language Server Init, Goto Definition, Error Popups) in #1740, #1737, #1736, following #1633, and #1642 last release. Reported and verified by geirs73.
These fixes have also made it possible to run our test suites on Windows runners to catch issues sooner in future. A huge thanks to @charlieegan3 for his tireless work on this!
Bugs fixed
rule[input[i]].allow if ....notcheck made an existence check necessary, reported by @gusegaInitOptionsis never nil and don't cause issues with clients that don't provide thoseDependency Updates:
Go modules:
github.com/open-policy-agent/opa:v1.8.0→v1.10.1github.com/arl/statsviz:v0.7.1→v0.7.2github.com/go-git/go-git/v5:v5.16.2→v5.16.3github.com/olekukonko/tablewriter:v0.0.5→v1.1.0github.com/spf13/cobra:v1.9.1→v1.10.1github.com/spf13/pflag:v1.0.7→v1.0.10github.com/coreos/go-semver:v0.3.1GitHub Actions:
open-policy-agent/setup-opa:v2.2.0→v2.3.0actions/cache:v4.2.4→v4.3.0actions/upload-artifact:v4.6.2→v5.0.0golangci/golangci-lint-action:v2.4.0→v2.5.0actions/setup-go:v5.5.0→v6.0.0Support
If you encounter any issues with this release, please either file an issue, or let us know in the #opa-regal channel in the OPA Slack!
Changelog
244459c: docs: Remove some old references (#1689) (@anderseknert)4212b5c: build(deps): bump the dependencies group with 2 updates (#1690) (@dependabot[bot])e149c6d: build: reduce update-caps top-level workflow permission to read (#1691) (@timothyklee)819bbec: lsp: Fix missing initial root (#1692) (@charlieegan3)be8b020: docs: Update style guide links to new repo (#1693) (@charlieegan3)ceb890b: Builtin function completion in Rego (#1694) (@anderseknert)d36555e: Package ref import suggestions in Rego (#1698) (@anderseknert)4e44131: build(deps): bump the dependencies group with 2 updates (#1703) (@dependabot[bot])14166e9: Avoid multi-line highlighting of issues (#1702) (@anderseknert)1685bb8: Move completion handler into Rego router (#1699) (@anderseknert)0da5eaa: build(deps): bump the dependencies group with 2 updates (#1708) (@dependabot[bot])e792757: Bump OPA -> v1.9.0, golangci-lint 2.5.0 (#1709) (@anderseknert)3092d1d: docs: Address some broken links from OPA report (#1704) (@charlieegan3)bebfd06: util: use Partial2 for IsAnyError (@srenatus)f22a570: Fix false positive inredundant-existence-check(#1716) (@anderseknert)2703715: Various fixes (#1715) (@anderseknert)87981f2: build(deps): bump the dependencies group with 2 updates (#1713) (@dependabot[bot])a6487b6: lsp: document highlighting supporting function args (#1718) (@anderseknert)fe8cbd3: Rule: prefer-equals-comparison (#1726) (@anderseknert)f3722ea: Fix false positive in narrow-argument (#1724) (@anderseknert)73b8c65: Improve pointless-reassignment to cover nested cases (#1727) (@anderseknert)9cf180c: lsp: Implement selection ranges and linked editing range (#1722) (@anderseknert)bf632d0: build(deps): bump the dependencies group with 2 updates (#1725) (@dependabot[bot])a373ae3: lsp: Use filename path for current buffer for defns (#1732) (@charlieegan3)d758eaf: lsp: Refactor range utilities (#1729) (@anderseknert)13de8a9: Fix incorrect behavior in pointless-import (#1733) (@anderseknert)fb560c1: Fix false positive in use-some-for-output-vars (#1731) (@anderseknert)70449b7: Various small fixes (#1736) (@anderseknert)2594719: windows: Better use of slash paths (#1737) (@charlieegan3)499125f: Get FindClosestMatchingRoot working on windows (#1740) (@charlieegan3)3715085: OPA v1.10.0 (#1742) (@anderseknert)781f809: deps: stick to github.com/vektah/gqlparser/v2@v2.5.30 (#1744) (@srenatus)bbb03db: Use generic client identifier in tests (#1741) (@charlieegan3)c42ce08: build(deps): bump github/codeql-action in the dependencies group (#1745) (@dependabot[bot])4384b0d: Remove go-semver dependency, plus various fixes (#1746) (@anderseknert)97dfbd4: docs: update LSP page to show new features (#1748) (@charlieegan3)818b33a: docs: Minor fixes to docs typos and links (#1747) (@charlieegan3)4138270: Update to OPA v1.10.1 (@charlieegan3)55cf029: lsp: ensure thatInitOptionsis never nil (#1752) (@srenatus)8ffa270: docs: add kakoune LSP config snippet (#1751) (@srenatus)216341a: reporter,lsp: update URLs for help links (#1750) (@srenatus)Configuration
📅 Schedule: Branch creation - "after 1am on monday" (UTC), 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.
This PR has been generated by Renovate Bot.