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

feat(query): add Regal for linting Rego #6774

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anderseknert
Copy link

Hello, friends at Kics! This PR introduces Regal for linting the massive Rego library included in this project. Given the size of this policy library, it should come as no surprise that a linter has much to say :) I've tried to fix the reported issues that seem safe to address, while configuring Regal to ignore the rest, leaving it to the maintainers of this project to decide what they'll want to enforce going forward. I've annotated the provided config file with some pointers and suggestions to try and make that chore a little easier.

Reported issues fixes as part of this:

Idiomatic:

Bugs:

Style

Imports

I've also added linting of Rego as a new job for CI.

Let me know what you all think!

I submit this contribution under the Apache-2.0 license.

@github-actions github-actions bot added community Community contribution bug Something isn't working labels Oct 22, 2023
Hello, friends at Kics! This PR introduces [Regal](https://github.com/styrainc/regal)
for linting the massive Rego library included in this project. Given the size of
this policy library, it should come as no surprise that a linter has much to say :)
I've tried to fix the reported issues that seem safe to address, while configuring
Regal to ignore the rest, leaving it to the maintainers of this project to decide
what they'll want to enforce going forward. I've annotated the provided config file
with some pointers and suggestions to try and make that chore a little easier.

Reported issues fixes as part of this:

Idiomatic:
* [custom-has-key-construct](https://docs.styra.com/regal/rules/idiomatic/custom-has-key-construct)
* [custom-in-construct](https://docs.styra.com/regal/rules/idiomatic/custom-in-construct)

Bugs:
* [rule-shadows-builtin](https://docs.styra.com/regal/rules/bugs/rule-shadows-builtin)

Style
* [default-over-else](https://docs.styra.com/regal/rules/style/default-over-else)
* [unconditional-assignment](https://docs.styra.com/regal/rules/style/unconditional-assignment)

Imports
* [redundant-alias](https://docs.styra.com/regal/rules/imports/redundant-alias)
* [import-after-rule](https://docs.styra.com/regal/rules/imports/import-after-rule)

I've also added linting of Rego as a new job for CI.

Let me know what you all think!

Signed-off-by: Anders Eknert <anders@styra.com>
@anderseknert anderseknert changed the title Add Regal for linting Rego feat(query): add Regal for linting Rego Oct 22, 2023
@github-actions github-actions bot added feature request Community: new feature request query New query feature labels Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Community contribution feature request Community: new feature request query New query feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant