Skip to content

Double-braces incorrectly trigger braces/min-spaces-inside #781

@sbrowne-godaddy

Description

@sbrowne-godaddy

When using the following snippet of .yamllint:

---
extends: default
  braces:
    min-spaces-inside: 1
    max-spaces-inside: 1

A YAML file that has a value with double braces incorrectly triggers:

---
keyname: {{ value }}

The output is as such:

[user@laptop sceptre (master)]$ ~/.cache/pre-commit//repo7_jyo6cg/py_env-python3.13/bin/yamllint test.yaml 
test.yaml
  2:11      error    too few spaces inside braces  (braces)
  2:20      error    too few spaces inside braces  (braces)

A quick flick through the spec doesn't immediately reject the use of {{.

In particular, Sceptre (for AWS CloudFormations) make use of this form of double-brace.

It would be nice if this could either be handled by default or a new rule could be created to allow for it to treat them as single-brace (for linting purposes).

[user@laptop sceptre (master)]$ ~/.cache/pre-commit//repo7_jyo6cg/py_env-python3.13/bin/yamllint --version
yamllint 1.37.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions