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

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=INFO msg="Finding all rules to check" paths=["rules"]
level=INFO msg="Checking Prometheus rules" entries=4 workers=10 online=true
Bug: duration required (rule/for)
  ---> rules/0001.yml:6 -> `3m` [+1 duplicates]
6 |   keep_firing_for: 3m
                       ^^
                       This alert rule must have a `keep_firing_for` field with a minimum duration of
                       5m.

Bug: duration too long (rule/for)
  ---> rules/0001.yml:9 -> `13m`
9 |   keep_firing_for: 13m
                       ^^^
                       This alert rule must have a `keep_firing_for` field with a maximum duration of
                       10m.

level=INFO msg="Some problems are duplicated between rules and all the duplicates were hidden, pass `--show-duplicates` to see them" total=3 duplicates=1 shown=2
level=INFO msg="Problems found" Bug=3
level=ERROR msg="Execution completed with error(s)" err="found 3 problem(s) with severity Bug or higher"
-- rules/0001.yml --
- alert: ok
  expr: up == 0
  keep_firing_for: 5m
- alert: 3m
  expr: up == 0
  keep_firing_for: 3m
- alert: 13m
  expr: up == 0
  keep_firing_for: 13m
- alert: none
  expr: up == 0

-- .pint.hcl --
parser {
  relaxed = [".*"]
}
rule {
  keep_firing_for {
    severity = "bug"
    min      = "5m"
    max      = "10m"
  }
}
