Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate rego when parsing rule types (#4906)
This adds rego module parsing as part of the rule type validation. This enables us to catch errors faster as opposed to needing to evaluate a policy to figure out if the rule type was valid. If we have a rule with invalid rego, we'd get errors as follows: ``` $ mindev ruletype lint -r rule-types/github/no_binaries_in_repo.yaml error validating rule type from file rule-types/github/no_binaries_in_repo.yaml: invalid rule type invalid rule type definition: rego definition is invalid: 1 error occurred: minder-ruletype-def.rego:16: rego_parse_error: unexpected eof token msg := sprintf("Binary artifact found: %s", [current_file]) ^ Error: failed linting rule type Message: Error on execute Details: failed linting rule type ``` Signed-off-by: Juan Antonio Osorio <[email protected]>
- Loading branch information