Skip to content

empty list item gets trailing whitespace added #56

@commonism

Description

@commonism

The following example is

a:
  -

hard to get right with

  - repo: 'https://github.com/pre-commit/pre-commit-hooks'
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace

  - repo: https://github.com/adrienverge/yamllint.git
    rev: v1.35.1
    hooks:
      - id: yamllint
        args: ["-d", "{extends: relaxed, rules: {empty-lines: disable, line-length: {max: 1500}}}", --strict, --format, parsable]

  - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
    rev: 0.2.3
    hooks:
      - id: yamlfmt
        args: [--mapping, '2', --sequence, '4', --offset, '2', --preserve-quotes, --implicit_start, --width, '1500']

yamlfmt wants to add a trailing whitespace, the others disagree.
Only option so far is manually exclude file from yamlfmt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions