Use this rule to report duplicated anchors and aliases referencing undeclared anchors.

Parameters

forbid-undeclared-aliases
Set to true to avoid aliases that reference an anchor that hasn't been declared (either not declared at all, or declared later in the document).
forbid-duplicated-anchors
Set to true to avoid duplications of a same anchor.
forbid-unused-anchors
Set to true to avoid anchors being declared but not used anywhere in the YAML document via alias.

Examples

With anchors: {forbid-undeclared-aliases: true} the following code snippet would PASS:

    ---
    - &anchor
      foo: bar
    - *anchor

the following code snippets would FAIL:

    ---
    - &anchor
      foo: bar
    - *unknown
    ---
    - &anchor
      foo: bar
    - <<: *unknown
      extra: value

With anchors: {forbid-duplicated-anchors: true} the following code snippet would PASS:

    ---
    - &anchor1 Foo Bar
    - &anchor2 [item 1, item 2]

the following code snippet would FAIL:

    ---
    - &anchor Foo Bar
    - &anchor [item 1, item 2]

With anchors: {forbid-unused-anchors: true} the following code snippet would PASS:

    ---
    - &anchor
      foo: bar
    - *anchor

the following code snippet would FAIL:

    ---
    - &anchor
      foo: bar
    - items:
      - item1
      - item2