Use this rule to control the number of spaces before and after colons (:).

Parameters

max-spaces-before
Defines the maximal number of spaces allowed before colons (use -1 to disable).
max-spaces-after
Defines the maximal number of spaces allowed after colons (use -1 to disable).

Examples

With max-spaces-before = 0 and max-spaces-after = 1 the following code snippet would PASS:

      object:
        - a
        - b
      key: value

With max-spaces-before = 1 the following code snippet would PASS:

    object :
      - a
      - b

the following code snippet would FAIL:

    object  :
      - a
      - b

With max-spaces-after = 2 the following code snippet would PASS:

    first:  1
    second: 2
    third:  3

the following code snippet would FAIL:

    first: 1
    2nd:   2
    third: 3