# -*- mode: yaml -*-
# vim:ts=2:sw=2:ai:si:syntax=yaml
#
# Copyright (C) 2017 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2017 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# yamllint configuration directives
#
# Project Homepage: https://github.com/adrienverge/yamllint
#
# How to override rules in files:
# https://yamllint.readthedocs.io/en/latest/disable_with_comments.html

---
extends: default

# Rules documentation: https://yamllint.readthedocs.io/en/latest/rules.html
rules:

  braces:
    # Defaults
    # min-spaces-inside: 0
    # max-spaces-inside: 0

    # Keep 0 min-spaces to not error on empty {} collection definitions
    min-spaces-inside: 0

    # Allow one space inside braces to improve code readability
    max-spaces-inside: 1

  brackets:
    # Defaults
    # min-spaces-inside: 0
    # max-spaces-inside: 0

    # Keep 0 min-spaces to not error on empty [] collection definitions
    min-spaces-inside: 0

    # Allow one space inside braces to improve code readability
    max-spaces-inside: 1

  colons:
    # Defaults
    # min-spaces-before: 0
    # max-spaces-after: 1

    # Allow multiple spaces after a colon to allow indentation of YAML
    # dictionary values
    max-spaces-after: -1

  commas:
    # Defaults
    # max-spaces-after: 1

    # Allow multiple spaces after a comma to allow indentation of YAML
    # dictionary values
    max-spaces-after: -1

  comments:
    # Defaults
    # level: warning
    # require-starting-space: True
    # min-spaces-from-content: 2

    # Disable to allow for code comment blocks and #!/usr/bin/ansible-playbook
    require-starting-space: False

  # Disable comment indentation checks due to copious amounts of long lines in
  # the code which would require a code style change to resolve
  comments-indentation: False

  indentation:
    # Defaults
    # spaces: consistent
    # indent-sequences: True
    # check-multi-line-strings: False

    # Require 2 space indentation
    spaces: 2

    # Require consistent indentation within a file, either indented or not
    indent-sequences: consistent

  # Disable line length checks due to copious amounts of long lines in the code
  # which would require a code style change to resolve
  #
  # Defaults
  # max: 80
  # allow-non-breakable-words: True
  # allow-non-breakable-inline-mappings: False
  line-length: disable

  # Disable truthy checks due to copious amounts of truthy warnings in the code
  # which would require a code style change to resolve
  #
  # Defaults
  # level: warning
  truthy: disable
