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

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
rules/0001.yml:11-13: link annotation is required (alerts/annotation)
 11 |     annotations:
 12 |       summary: "Instance {{ $labels.instance }} down"
 13 |       description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes."

rules/0001.yml:17: job label is required and should be preserved when aggregating "^.+$" rules, use by(job, ...) (promql/aggregate)
 17 |     expr: sum by (instance) (http_inprogress_requests) > 0

rules/0001.yml:19-21: link annotation is required (alerts/annotation)
 19 |     annotations:
 20 |       summary: "High request latency on {{ $labels.instance }}"
 21 |       description: "{{ $labels.instance }} has a median request latency above 1s (current value: {{ $value }}s)"

level=info msg="Problems found" Bug=2 Warning=1
level=fatal msg="Fatal error" error="problems found"
-- rules/0001.yml --
groups:
- name: example
  rules:

  # Alert for any instance that is unreachable for >5 minutes.
  - alert: InstanceDown
    expr: up == 0
    for: 5m
    labels:
      severity: page
    annotations:
      summary: "Instance {{ $labels.instance }} down"
      description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes."

  # Alert for any instance that has a median request latency >1s.
  - alert: APIHighRequestLatency
    expr: sum by (instance) (http_inprogress_requests) > 0
    for: 10m
    annotations:
      summary: "High request latency on {{ $labels.instance }}"
      description: "{{ $labels.instance }} has a median request latency above 1s (current value: {{ $value }}s)"

-- .pint.hcl --
rule {
    aggregate ".+" {
        keep = [ "job" ]
    }
}
rule {
    aggregate "colo(?:_.+)?:.+" {
        strip = [ "instance" ]
    }
    annotation "link" {
        required = true
        severity = "bug"
    }
}
