Skip to content

Files

Latest commit

 

History

History
43 lines (27 loc) · 843 Bytes

key-duplicates.md

File metadata and controls

43 lines (27 loc) · 843 Bytes

Pattern: Duplicate mapping key

Issue: -

Description

This rule checks for multiple entries with the same key in mappings.

Examples

  1. With key-duplicates: {}

    the following code snippet would PASS:

    - key 1: v
      key 2: val
      key 3: value
    - {a: 1, b: 2, c: 3}
    

    the following code snippet would FAIL:

    - key 1: v
      key 2: val
      key 1: value
    

    the following code snippet would FAIL:

    - {a: 1, b: 2, b: 3}
    

    the following code snippet would FAIL:

    duplicated key: 1
    "duplicated key": 2
    
    other duplication: 1
    ? >-
        other
        duplication
    : 2
    

Further Reading