# Two groups share the same name via YAML alias, strict mode detects the duplicate.

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

-- stderr.txt --
level=INFO msg="Finding all rules to check" paths=["rules"]
level=WARN msg="Failed to parse file content" err="duplicated group name" path=rules/rules.yml line=6
level=INFO msg="Checking Prometheus rules" entries=1 workers=10 online=true
Fatal: duplicated group name (yaml/parse)
  ---> rules/rules.yml:6
6 | - name: *gname
             ^^^^^ duplicated group name

level=INFO msg="Problems found" Fatal=1
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/rules.yml --
groups:
- name: &gname mygroup
  rules:
  - record: foo
    expr: sum(up)
- name: *gname
  rules:
  - record: bar
    expr: sum(down)

