! 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=2 workers=10 online=true
Bug: required label is being removed via aggregation (promql/aggregate)
  ---> rules/0002.yml:2 -> `colo:test2`
2 |   expr: sum(foo) without(job)
                             ^^^
                             Query is using aggregation with `without(job)`, all labels included inside
                             `without(...)` will be removed from the results.
                             `job` label is required and should be preserved when aggregating all rules.

level=INFO msg="Problems found" Bug=1
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/0001.yml --
- record: "colo:test1"
  expr: sum(foo) without(job)
-- rules/0002.yml --
- record: "colo:test2"
  expr: sum(foo) without(job)
-- .pint.hcl --
parser {
  relaxed = [".*"]
}
rule {
    match {
        path = "rules/0002.yml"
    }
    aggregate ".+" {
        severity = "bug"
        keep = [ "job" ]
    }
}
