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

Add Regal Rego linting to project #326

Closed
wants to merge 1 commit into from
Closed

Add Regal Rego linting to project #326

wants to merge 1 commit into from

Conversation

anderseknert
Copy link

Hello Elastic friends! 👋😃 Good to see so many familiar faces in the list of contributors here. Regal is a linter for Rego, and it's reaching a level of maturity where I feel confident putting it to use in some serious policy libraries.

Besides linting, the CI integration helps annotate PRs with violations at the location they happened, helping developers quickly figure out what they need to change.

As part of integrating the linter in this repo, I went ahead and fixed a number of issues reported. Naturally, I've made sure that all the Rego tests pass, but if there's any change you feel was too invasive, or perhaps changed code that some other project depend on, do let me know and I'll be happy to revert that.

Issues fixed for the following rules:

Many issues, primarily related to style, have been disabled in the Regal config for now, and I'm sure you'll want to work on having some of them enabled later.

Have a great weekend!

Hello elastic friends! 👋😃 Good to see so many familiar faces
in the list of contributors here. [Regal](https:/StyraInc/regal)
is a linter for Rego, and it's reaching a level of maturity where
I feel confident putting it to use in some serious policy libraries.

Besides linting, the CI integration helps annotate PRs with violations
at the location they happened, helping developers quickly figure out what
they need to change.

As part of integrating the linter in this repo, I went ahead and fixed a
number of issues reported. Naturally, I've made sure that all the Rego
tests pass, but if there's any change you feel was too invasive, or perhaps
changed code that some other project depend on, do let me know and I'll be
happy to revert that.

Issues fixed for the following rules:

* [not-equals-in-loop](https://docs.styra.com/regal/rules/bugs/not-equals-in-loop)
* [unconditional-assignment](https://docs.styra.com/regal/rules/style/unconditional-assignment)
* [use-in-operator](https://docs.styra.com/regal/rules/idiomatic/use-in-operator)
* [redundant-alias](https://docs.styra.com/regal/rules/imports/redundant-alias)
* [no-whitespace-comment](https://docs.styra.com/regal/rules/style/no-whitespace-comment)
* [constant-condition](https://docs.styra.com/regal/rules/bugs/constant-condition)
* [non-raw-regex-pattern](https://docs.styra.com/regal/rules/idiomatic/non-raw-regex-pattern)
* [redundant-alias](https://docs.styra.com/regal/rules/imports/redundant-alias)

Many issues, primarily related to style, have been disabled in the Regal config
for now, and I'm sure you'll want to work on having some of them enabled later.

Have a great weekend!

Signed-off-by: Anders Eknert <[email protected]>
@anderseknert anderseknert requested a review from a team as a code owner October 6, 2023 13:56
@cla-checker-service
Copy link

cla-checker-service bot commented Oct 6, 2023

💚 CLA has been signed

@mergify
Copy link

mergify bot commented Oct 6, 2023

This pull request does not have a backport label. Could you fix it @anderseknert? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit
    NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label Oct 6, 2023
@orestisfl
Copy link
Contributor

@anderseknert Thank you for your contribution, this is amazing!

Sorry for the delayed response, we just merged this repo into the main cloudbeat repo: elastic/cloudbeat#1405.

We are not going to update the main branch of this repo anymore, can you please re-create your PR in cloudbeat repo: https:/elastic/cloudbeat.

I am going to close this PR for this reason, but I just want to repeat that your contribution is super welcome 👍

@orestisfl orestisfl closed this Oct 30, 2023
@anderseknert
Copy link
Author

Oh, I see, @orestisfl. I'll look into that then, and will submit a PR against that repo 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants