---
# yamllint configuration for Ansible collections
# See: https://yamllint.readthedocs.io/en/stable/rules.html

extends: default

rules:
  # Line length
  line-length:
    max: 120
    level: warning

  # Comments
  comments:
    min-spaces-from-content: 1
  comments-indentation: false

  # Indentation
  indentation:
    spaces: 2
    indent-sequences: true

  # Octal values
  octal-values:
    forbid-implicit-octal: true
    forbid-explicit-octal: true

  # Truthy values
  truthy:
    allowed-values: ['true', 'false', 'yes', 'no']
    check-keys: false

  # Brackets
  brackets:
    min-spaces-inside: 0
    max-spaces-inside: 1

  # Braces
  braces:
    min-spaces-inside: 0
    max-spaces-inside: 1

  # Document start (---)
  document-start:
    present: true

  # Empty lines
  empty-lines:
    max: 2

  # Trailing spaces
  trailing-spaces: enable

  # Key duplicates
  key-duplicates: enable

ignore: |
  .ansible/
  .cache/
  .git/
  .github/
  .molecule/
  .venv/
  venv/
