Back to Opa

annotation-without-metadata

docs/projects/regal/rules/bugs/annotation-without-metadata.md

1.16.11.0 KB
Original Source

annotation-without-metadata

Summary: Annotation without metadata

Category: Bugs

Avoid

rego
package policy

# description: allow allows
allow if {
    # ... some conditions
}

Prefer

rego
package policy

# METADATA
# description: allow allows
allow if {
    # ... some conditions
}

Rationale

A comment that starts with <annotation-attribute>: but is not part of a metadata block is likely a mistake. Add # METADATA above the line to turn it into a metadata block.

Configuration Options

This linter rule provides the following configuration options:

yaml
rules:
  bugs:
    annotation-without-metadata:
      # one of "error", "warning", "ignore"
      level: error