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.
What is this PR About?
Hello, Red Hat friends :)
This PR adds Regal for linting the Rego contained in this repo.
Practically, this PR adds a Regal configuration file adapted to the project, where some of the most reported style issues are ignoed for the time being. Additionally, we're adding a linter job to the CI pipeline to ensure future updates to policy if compliant as well.
A few (hopefully) uncontroversial issues reported have also been fixed:
While the changes are non-intrusive, and should have no impact on evaluation, I naturally wanted to run the tests included in this repo and followed the instructions in TESTING.md. However, even after having installed all of the dependencies listed as required, the test command fails due to a missing
oc
command. I tried to find that and possibly update the TESTING.md file to include it, but the instructions I followed suggested logging in to a "Red Hat Customer Portal" to get it. If being a customer is required to run the tests, that requirement would be good to add to the docs as well.