Skip to main content

<defaults>

<defaults> gives every rule in its file a category and a severity to fall back on. A file has at most one, before its first entry.

<defaults>
category: functional_correctness
severity: blocking
</defaults>

The block is YAML (or JSON). It takes no attributes. A rule's own attributes take precedence over the defaults, and defaults never apply to a context.

Keys​

KeyRequiredTypeDescription
categorynostringThe category for rules that set none.
severitynoblocking or advisoryThe severity for rules that set none.

category​

  • Type: string matching ^[a-z][a-z0-9_]*$, and known for the file.
  • Required: no.

A category that is not known is unknown-category. In <defaults> that error excludes the whole file, even its rules that set their own category.

category: security

severity​

  • Type: blocking or advisory.
  • Required: no.

Without it, a rule that sets no severity is advisory.

severity: blocking

Errors​

Every error in <defaults> excludes the whole file. Any other key, or a value such as severity: critical, is invalid-defaults.

Specification​