Add Regal for linting Rego#454
Merged
Merged
Conversation
jalseth
approved these changes
Nov 26, 2023
Collaborator
jalseth
left a comment
There was a problem hiding this comment.
LGTM, thanks Anders!
The failing CI is unrelated to this change.
jalseth
requested changes
Nov 27, 2023
Collaborator
jalseth
left a comment
There was a problem hiding this comment.
@anderseknert Scratch that, please rebase on main. I think you will need to generate the Gatekeeper YAMLs as you changed the source and the acceptance tests verify the YAMLs are generated correctly.
Contributor
Author
|
@jalseth it's bedtime here, but will do tomorrow 👍 |
I think you're all familiar with [Regal](https://github.com/styrainc/regal) by now, so I'll skip the introduction :) This PR introduces the OPA community's favorite linter to the Konstraint project, and along with that a bunch of fixes as suggested by the linter. Regal checks addressed: * [import-after-rule](https://docs.styra.com/regal/rules/imports/import-after-rule) * [line-length](https://docs.styra.com/regal/rules/style/line-length) * [unconditional-assignment](https://docs.styra.com/regal/rules/style/unconditional-assignment) * [use-assignment-operator](https://docs.styra.com/regal/rules/style/use-assignment-operator) * [use-in-operator](https://docs.styra.com/regal/rules/idiomatic/use-in-operator) * [use-some-for-output-vars](https://docs.styra.com/regal/rules/idiomatic/use-some-for-output-vars) OPA strict mode compliance: * Variables must not shadow `input` Both have been added to the CI pipeline to ensure future compliance. Make sure to check in every once in a while, as new Regal releases are published quite frequently, and there's often some useful new rule included in each release. Fixes #446 Signed-off-by: Anders Eknert <[email protected]>
Contributor
Author
|
@jalseth done 👍 But I was able to resolve that by simply creating the directory first. There's also a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I think you're all familiar with Regal by now, so I'll skip the introduction :) This PR introduces the OPA community's favorite linter to the Konstraint project, and along with that a bunch of fixes as suggested by the linter.
Regal checks addressed:
OPA strict mode compliance:
inputBoth have been added to the CI pipeline to ensure future compliance. Make sure to check in every once in a while, as new Regal releases are published quite frequently, and there's often some useful new rule included in each release.
Fixes #446