! exec pint --no-color lint rules
! stdout .
cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Finding all rules to check" paths=["rules"]
level=INFO msg="Checking Prometheus rules" entries=5 workers=10 online=true
Fatal: This rule is not a valid Prometheus rule: `incomplete rule, no alert or record key`. (yaml/parse)
  ---> rules/strict.yml:4
 4 |   - expr: MissingAlertOrRecord
     ^^^ This rule is not a valid Prometheus rule: `incomplete rule, no alert or record key`.

Fatal: This rule is not a valid Prometheus rule: `expr value cannot be empty`. (yaml/parse)
  ---> rules/strict.yml:7
 7 |     expr: 
     ^^^ This rule is not a valid Prometheus rule: `expr value cannot be empty`.

Fatal: PromQL syntax error (promql/syntax)
  ---> rules/strict.yml:10 -> `BadPromQL`
10 |     expr: sumz(0)
               ^^^^ unknown function with name "sumz"

Fatal: template syntax error (alerts/template)
  ---> rules/strict.yml:15 -> `IgnoreTemplateErrors` [+1 duplicates]
15 |       dashboard: '{{ bogus }}'
                       ^^^^^^^^^^^ Template failed to parse with this error: `function "bogus" not defined`.

level=INFO msg="Some problems are duplicated between rules and all the duplicates were hidden, pass `--show-duplicates` to see them" total=5 duplicates=1 shown=4
level=INFO msg="Problems found" Fatal=5
level=ERROR msg="Execution completed with error(s)" err="found 5 problem(s) with severity Bug or higher"
-- rules/strict.yml --
groups:
- name: foo
  rules:
  - expr: MissingAlertOrRecord

  - alert: MissingExpr
    expr: 

  - record: BadPromQL
    expr: sumz(0)

  - alert: IgnoreTemplateErrors
    expr: up == 0
    annotations:
      dashboard: '{{ bogus }}'

  - alert: IgnoreTemplateErrors
    expr: up == 0
    labels:
      dashboard: '{{ bogus }}'
