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

policy: Add Regal for linting Rego #262

Closed
wants to merge 1 commit into from
Closed

Conversation

gal-legit
Copy link
Collaborator

This PR introduces Regal for linting the Rego files of the project. The Rego found here is generally in a good shape, so only a few rules have been either ignored or fixed. The few rules fixed include:

Included is also a new job for checking/linting Rego code as part of CI.

What's being changed?

Is this PR related to an existing issue?

Check off the following:

  • This PR follows the CONTRIBUTION.md guidelines
  • I have self-reviewed my changes before submitting the PR

This PR introduces [Regal](https://github.com/styrainc/regal) for linting
the Rego files of the project. The Rego found here is generally in a good
shape, so only a few rules have been either ignored or fixed. The few rules
fixed include:
* [rule-shadows-builtin](https://docs.styra.com/regal/rules/bugs/rule-shadows-builtin)
  as there is already an `is_null` function in the standard lib
* [custom-has-key-construct](https://docs.styra.com/regal/rules/idiomatic/custom-has-key-construct)
  as this is handled by `object.keys` and `in` in modern Rego
* [use-assignment-operator](https://docs.styra.com/regal/rules/style/use-assignment-operator)
  as `:=` is preferred over `=` for rule assignment, and using this does
  not change the semantics of the code in any way.

Included is also a new job for checking/linting Rego code as part of CI.

Signed-off-by: Anders Eknert <[email protected]>
@gal-legit gal-legit requested a review from a team as a code owner October 29, 2023 16:44
@ghost
Copy link

ghost commented Oct 29, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@gal-legit
Copy link
Collaborator Author

opened only to run e2e

@gal-legit gal-legit closed this Oct 29, 2023
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.

2 participants