Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regal 0.31.0 #207309

Merged
merged 2 commits into from
Feb 11, 2025
Merged

regal 0.31.0 #207309

merged 2 commits into from
Feb 11, 2025

Conversation

BrewTestBot
Copy link
Member

Created by brew bump


Created with brew bump-formula-pr.

release notes
This release of Regal updates to OPA v1.1.0, continuing to solidify support for v1 Rego with some nice new rules, performance improvements and bug fixes too.

New Rule: use-object-keys

There are some cases where using object.keys is preferred over using comprehensions. For example:

Avoid

package policy

keys := {k | some k, _ in input.object}

Prefer

package policy

keys := object.keys(input.object)

This is preferred as it more clearly communicates the intent of the code, that is, to get the keys of the object rather than loop over it and collect the keys as you go. More details can be found on the use-object-keys rule page.

New Rule: non-loop-expression

Expressions in loops are evaluated in each iteration of the loop and so it's advisable to avoid using expressions which do not depend on the loop variable within the looping part of a rule in order to improve performance.

Avoid

package policy
allow if {
    some email in input.emails
    admin in input.roles # <- this is not required in the loop
    endswith(email, "@example.com")
}

Prefer

package policy
allow if {
    admin in input.roles # <- moved out of the loop
    some email in input.emails
    endswith(email, "@example.com")
}

This rule can't catch all cases, so still be on the look out. More details can be found on the non-loop-expression rule page.

Fixing non-raw-regex-pattern

The non-raw-regex-pattern rule can now be automatically fixed with regal fix or with a CodeAction for language server clients. StyraInc/regal#1382

Configuration File Loading

Regal will now use a ~/.config/regal if no parent configuration is found. This is useful when working on Rego in temporary directories. StyraInc/regal#1378

Regal's language server will now use configuration files in the workspace tree if they exist rather than only looking at parent directories. This more closely matches the behavior of the lint command. StyraInc/regal#1372

Notable Improvements

Notable Fixes & Updates

Changelog

  • 1eff70ad6f4667f7828df7fe6f9cc02dd4e784c0: fix: lsp - filter out regal.debug codelens (#1345) (@jglasovic)
  • 93faa404ce5231a4a971f0b40f59e9e21736d49a: [create-pull-request] automated change (@charlieegan3)
  • 193224a5033c5577b36d305fc2e7997eb8c9635c: [create-pull-request] automated change (@charlieegan3)
  • 434dabfdc903e219307df9bd9465441bc02a6b60: build(deps): bump golangci/golangci-lint-action (#1350) (@dependabot[bot])
  • d7f522efa04c5d19fc3856a320774c59acf56bea: Add workspace folder type, and "support" that capability (#1347) (@anderseknert)
  • a5d17429142ebfd78e2bad172a1147376e2e59be: Language server refactoring (#1349) (@anderseknert)
  • 7b693ee1ec8b6634665a17feab9c0e55f804a782: perf: move config check out of loop (#1351) (@anderseknert)
  • d9749f40a8425bab80b37d835dbf4515a4063db9: lsp: Ensure parse errors are saved as diagnostics correctly (#1352) (@charlieegan3)
  • bea7398f684fd618f66c17013276259b7c0f3c55: Fix missing annotations in LSP parsing (#1354) (@anderseknert)
  • 0a175344d60b6ee0f2b44e790cc6db0fbd19e41e: chore: Use regal's parse options following (#1355) (@charlieegan3)
  • 760b484bdbecb62c20e3027dc39c5cac2df7ee4f: fix: Remove mandatory fixes (#1356) (@charlieegan3)
  • 2b254936f108f27b327f3f07b05482593a8c0fc2: config: Search for .regal.yaml and use for roots (#1357) (@charlieegan3)
  • 6880526fd79b6e6d2f08800aff3b89c9ea3e7775: Remove custom Ref stringer (#1359) (@anderseknert)
  • 0d506bb3f3c7bbf3a596a55d0d157d95d19c0ad8: refactor: better use of test helpers (#1358) (@anderseknert)
  • b29ad4413e55901ededca36a7b94c99e20336f0f: perf: always include ignore_files in data (#1360) (@anderseknert)
  • 856bf507d44d8ae4d16430d64d6b551f95a9c48a: The compact output format should include a summary #1364 (#1369) (@anaypurohit0907)
  • 902000084f187a92c928eba139430c3873a90d88: Some style fixes (#1370) (@anderseknert)
  • f78f94bfe4e374e4cc5798e78e42849bff047b21: fix: better location reporting in use-if rule (#1362) (@anderseknert)
  • 1175266a32182e91c2337db9600fa39382faf85f: docs: deprecated built-in replacements (#1366) (@anderseknert)
  • 33408e5f352fcb4d9bff7c2dc78f660aea5e23eb: Add optional govet checks (#1368) (@anderseknert)
  • 1db229a520710c814cacc2a8e4cf9ec1f60f3c66: Small fixes (#1367) (@anderseknert)
  • 6430f860cb96b6ec26d151408b200ee75e341288: build(deps): bump the dependencies group with 3 updates (#1371) (@dependabot[bot])
  • 14cbc3b526066db4fae2438aebeb85771f5815d2: Bump OPA to v1.1.0 (#1373) (@anderseknert)
  • e1247eaeb7abc3f6a49bb8bc909e4f10d24e2b1d: Don't return error from regal.last (#1374) (@anderseknert)
  • 0e794a2f9b0410db737e90ed0c5d6d65830756d7: lsp: Use nested workspace configuration if found (#1372) (@charlieegan3)
  • d41c3da2c30e40e8e07c368194f81c2f3ed80965: [create-pull-request] automated change (#1376) (@github-actions[bot])
  • 1f9e2e44edb1a946256257fd59e68370e66ff126: Use .Keys() and .KeysSorted() from OPA (#1379) (@anderseknert)
  • a295fef292dd7fb99741c02e4772ebff58e9007f: config: Use global user config if required (#1378) (@charlieegan3)
  • 1a3fcfb18305196be267dda0ada8bae69a9dd275: linter: Show error if rule or category is invalid (#1381) (@charlieegan3)
  • 0e38b3786746b27fe2a91b1caec4eaef0e25077d: Add a few more adopters (#1384) (@anderseknert)
  • cb81676243208935586f6d5c41b9562c348f4582: build(deps): bump the dependencies group with 2 updates (#1385) (@dependabot[bot])
  • 4777c2b6dd806c7210f5a4d55530f168ad7fac97: build(deps): bump github/codeql-action in the dependencies group (#1386) (@dependabot[bot])
  • be9bc33cae78e9c64fd0b477015a5fa322a396d3: fix: non-raw regex pattern (#1382) (@charlieegan3)
  • 13a498010b1e3b7a0d0c3b2d96288ebd10e48725: lsp: Add statsviz for profiling visuals (#1388) (@charlieegan3)
  • ba53d753e92abe9c38b241e237f8357b8ea173b9: Consistently use new Set type (#1383) (@anderseknert)
  • 4347b8a0cb19888284deb52bdd5e1b96a3a40a8c: lsp/test: Error in test should be log instead (#1389) (@charlieegan3)
  • 8c15f1ca42a447e72c34d8935302215a9cd1ca59: [create-pull-request] automated change (@charlieegan3)
  • a283bee6b638b82b5d7c15d2929ea196c88417c0: Remove unused fixer code (#1392) (@anderseknert)
  • 194116f64aa12acb30f4374a617eeba0ee8d9a29: Rego-based opa-fmt (#1393) (@anderseknert)
  • 69e3756fe72876aa76db2fd05acc2cc2ad1692b8: Be specific about number of errors vs warnings in regal lint summary #821 (#1387) (@anaypurohit0907)
  • 48c9e5e1e0a73dc6c9a16b5a9bb11fd78640a6b9: Some minor cleanups in reporter code (#1397) (@anderseknert)
  • a4e359250a6c3a780c930139c9ce5894861aabea: Fix false positive in unused-output-variable (#1398) (@anderseknert)
  • c75d66f2534cded81a7707ac56524a99e8fceec9: Rule: use-object-keys (#1399) (@anderseknert)
  • 52c7c9baa23b382dc65fdea49c3c9ff7df091b6b: refactor: simplify data bundle creation (#1400) (@anderseknert)
  • 3e6ef5b35ad3fd3408a918ccb032cdffc3ec8e40: [create-pull-request] automated change (#1402) (@github-actions[bot])
  • 674e4414fce4e59b6485d93a3d684361cbe8d4b0: lsp: update log messages for root dir note (#1395) (@charlieegan3)
  • 76e0760e23bfff9e9779061a78345c826ecad50f: build(deps): bump the dependencies group with 2 updates (#1404) (@dependabot[bot])
  • c6d1a9dfc6d5e87696899184bd0ead60c98aa8af: Roast v0.8.1 (#1406) (@anderseknert)
  • 539ba39125b8e834feb308d7ebdf9e122fe83da1: bundle: Add non-loop-expression rule (#1401) (@charlieegan3)
  • 06af4dfd35ba6bc58e2797b0a7bd703eaa83072f: lsp: Correctly parse eval and debug params (#1407) (@charlieegan3)
  • b29e7594b2c538745ad45e530d70c05685fb8a88: lsp: show parse errors in diagnostics (#1408) (@charlieegan3)

@github-actions github-actions bot added go Go use is a significant feature of the PR or issue bump-formula-pr PR was created using `brew bump-formula-pr` labels Feb 11, 2025
Copy link
Contributor

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Feb 11, 2025
@BrewTestBot BrewTestBot added this pull request to the merge queue Feb 11, 2025
Merged via the queue into master with commit cd592c5 Feb 11, 2025
15 checks passed
@BrewTestBot BrewTestBot deleted the bump-regal-0.31.0 branch February 11, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-formula-pr PR was created using `brew bump-formula-pr` CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. go Go use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants