exec pint -l debug --no-color -d promql/counter -d alerts/for -d alerts/comparison -d promql/rate(prom) -d promql/series(prom) -d promql/aggregate(prom) -d promql/range_query lint rules
! stdout .
cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=DEBUG msg="Adding pint config to the parser exclude list" path=.pint.hcl
level=INFO msg="Finding all rules to check" paths=["rules"]
level=DEBUG msg="File parsed" path=rules/0001.yml rules=3
level=DEBUG msg="Glob finder completed" count=3
level=INFO msg="Configured new Prometheus server" name=prom uris=1 uptime=up tags=[] include=[] exclude=[]
level=DEBUG msg="Starting query workers" name=prom uri=http://127.0.0.1 workers=16
level=INFO msg="Checking Prometheus rules" entries=3 workers=10 online=true
level=DEBUG msg="Generated all Prometheus servers" count=1
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=default-for lines=1-3 state=noop
level=DEBUG msg="Configured checks for rule" enabled=["promql/syntax","alerts/template","promql/fragile","promql/regexp","promql/impossible","promql/vector_matching(prom)","rule/duplicate(prom)","labels/conflict(prom)","alerts/absent(prom)"] path=rules/0001.yml rule=default-for
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=sum:job lines=5-6 state=noop
level=DEBUG msg="Configured checks for rule" enabled=["promql/syntax","alerts/template","promql/fragile","promql/regexp","promql/impossible","promql/vector_matching(prom)","rule/duplicate(prom)","labels/conflict(prom)","alerts/absent(prom)","promql/aggregate(job:true)"] path=rules/0001.yml rule=sum:job
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=no-comparison lines=8-9 state=noop
level=DEBUG msg="Configured checks for rule" enabled=["promql/syntax","alerts/template","promql/fragile","promql/regexp","promql/impossible","promql/vector_matching(prom)","rule/duplicate(prom)","labels/conflict(prom)","alerts/absent(prom)"] path=rules/0001.yml rule=no-comparison
Warning: required label is being removed via aggregation (promql/aggregate)
  ---> rules/0001.yml:6 -> `sum:job`
6 |   expr: sum(foo)
            ^^^ Query is using aggregation that removes all labels.
                `job` label is required and should be preserved when aggregating all rules.

level=INFO msg="Problems found" Warning=1
level=DEBUG msg="Stopping query workers" name=prom uri=http://127.0.0.1
-- rules/0001.yml --
- alert: default-for
  expr: foo > 1
  for: 0m

- record: sum:job
  expr: sum(foo)

- alert: no-comparison
  expr: foo

-- .pint.hcl --
parser {
  relaxed = [".*"]
}
prometheus "prom" {
  uri     = "http://127.0.0.1"
  timeout = "5s"
}
checks {
  disabled = [ "alerts/external_labels" ]
}
rule {
    match {
      kind = "recording"
    }
    aggregate ".+" {
        keep = [ "job" ]
    }
}
