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

Method applyOPAFmt

app/cli/internal/policydevel/lint.go:261–268  ·  view source on GitHub ↗
(content, file string)

Source from the content-addressed store, hash-verified

259}
260
261func (p *PolicyToLint) applyOPAFmt(content, file string) string {
262 formatted, err := format.SourceWithOpts(file, []byte(content), format.Opts{})
263 if err != nil {
264 p.AddError(file, "auto-formatting failed", 0)
265 return content
266 }
267 return string(formatted)
268}
269
270// Runs the Regal linter on the given rego content and records any violations
271func (p *PolicyToLint) runRegalLinter(filePath, content string) {

Callers 2

validateAndFormatRegoMethod · 0.95

Calls 1

AddErrorMethod · 0.95

Tested by 1