(content, file string)
| 259 | } |
| 260 | |
| 261 | func (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 |
| 271 | func (p *PolicyToLint) runRegalLinter(filePath, content string) { |