exec pint --no-color -l debug 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=2
level=DEBUG msg="Glob finder completed" count=2
level=INFO msg="Checking Prometheus rules" entries=2 workers=10 online=true
level=DEBUG msg="Generated all Prometheus servers" count=0
level=DEBUG msg="Found recording rule" path=rules/0001.yml record=colo:recording lines=1-2 state=noop
level=DEBUG msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp","rule/dependency","promql/impossible","group/interval","promql/aggregate(job:true)"] path=rules/0001.yml rule=colo:recording
level=DEBUG msg="Found alerting rule" path=rules/0001.yml alert=colo:alerting lines=4-5 state=noop
level=DEBUG msg="Configured checks for rule" enabled=["promql/syntax","alerts/for","alerts/comparison","alerts/template","promql/fragile","promql/regexp","rule/dependency","promql/impossible","group/interval"] path=rules/0001.yml rule=colo:alerting
Warning: required label is being removed via aggregation (promql/aggregate)
  ---> rules/0001.yml:2 -> `colo:recording`
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" Warning=1
-- rules/0001.yml --
- record: "colo:recording"
  expr: sum(foo) without(job)

- alert: "colo:alerting"
  expr: sum(bar) without(job) > 0

-- .pint.hcl --
parser {
  relaxed = ["rules/.*"]
}
rule {
    match {
        kind = "recording"
    }
    aggregate ".+" {
        keep = [ "job" ]
    }
}
