---
# YAML Linting Configuration for Homelab
# Validates Docker Compose files and other YAML configurations

extends: default

rules:
  # Allow longer lines for Docker image names and URLs
  line-length:
    max: 120
    level: warning

  # Allow multiple spaces for alignment in Docker Compose
  indentation:
    spaces: 2
    indent-sequences: true
    check-multi-line-strings: false

  # Be flexible with comments (useful for service documentation)
  comments:
    min-spaces-from-content: 1

  # Allow empty values (common in Docker Compose environment variables)
  empty-values:
    forbid-in-block-mappings: false
    forbid-in-flow-mappings: false

  # Allow truthy values (yes/no, on/off common in Docker Compose)
  truthy:
    allowed-values: ['true', 'false', 'yes', 'no', 'on', 'off']
    check-keys: false

  # Allow duplicate keys in different contexts
  key-duplicates: disable

  # Allow document start marker to be optional
  document-start: disable

ignore: |
  # Ignore generated or external files
  archive/
  .git/
  **/*.md
  **/*.txt
  **/*.py
  **/*.sh
  **/*.conf
  **/*.ini
  # Ansible uses different YAML conventions (0-indent block sequences,
  # 2-indent task lists) that conflict with Docker Compose style rules.
  # Jinja2 {{ }} template expressions also trigger false positives.
  ansible/
  docs/advanced/ansible/
  # SNMP exporter generator configs use auto-generated 1/3-space indentation
  # that differs from standard YAML style but is valid and not hand-edited.
  **/prometheus/snmp.yml
  **/grafana_prometheus/snmp.yml
  **/grafana_prometheus/snmp_mariushosting.yml
