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

-- stderr.txt --
level=INFO msg="Finding all rules to check" paths=["rules"]
rules/01.yml:5 Warning: Alert query doesn't have any condition, it will always fire if the metric exists. (alerts/comparison)
 5 |     expr: sum(up{job="bar"}) / sum(foo) / sum(bar)

rules/01.yml:12 Bug: Template is using `cluster` label but the query removes it. (alerts/template)
 12 |         summary: "Server {{ $labels.instance }} in cluster {{ $labels.cluster }} has gone down"

rules/01.yml:12 Bug: Template is using `instance` label but the query removes it. (alerts/template)
 12 |         summary: "Server {{ $labels.instance }} in cluster {{ $labels.cluster }} has gone down"

rules/01.yml:13 Bug: Template is using `cluster` label but the query removes it. (alerts/template)
 13 |         dashboard: "https://grafana.example.com/dashboard?var-cluster={{ $labels.cluster }}&var-instance={{ $labels.cluster }}"

level=INFO msg="Problems found" Bug=3 Warning=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
-- rules/01.yml --
groups:
- name: foo
  rules:
  - alert: foo
    expr: sum(up{job="bar"}) / sum(foo) / sum(bar)
    for: 5m
    labels:
        priority: "2"
        component: bob
    annotations:
        link: https://example.com/link
        summary: "Server {{ $labels.instance }} in cluster {{ $labels.cluster }} has gone down"
        dashboard: "https://grafana.example.com/dashboard?var-cluster={{ $labels.cluster }}&var-instance={{ $labels.cluster }}"
