MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / validateRegoFile

Method validateRegoFile

app/cli/internal/policydevel/lint.go:206–217  ·  view source on GitHub ↗
(file *File)

Source from the content-addressed store, hash-verified

204}
205
206func (p *PolicyToLint) validateRegoFile(file *File) {
207 original := string(file.Content)
208 formatted := p.validateAndFormatRego(original, file.Path)
209
210 if p.Format && formatted != original {
211 if err := os.WriteFile(file.Path, []byte(formatted), 0600); err != nil {
212 p.AddError(file.Path, err.Error(), 0)
213 } else {
214 file.Content = []byte(formatted)
215 }
216 }
217}
218
219// validateWasmFile validates a WASM policy file by checking that it exports the required Execute function
220func (p *PolicyToLint) validateWasmFile(file *File) {

Callers 1

ValidateMethod · 0.95

Calls 3

validateAndFormatRegoMethod · 0.95
AddErrorMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected