# See https://pre-commit.com for more information
repos:
  - repo: https://github.com/Lucas-C/pre-commit-hooks
    rev: v1.5.5
    hooks:
      - id: remove-tabs

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace # trims trailing whitespace.
        exclude: ^archive/
      - id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline.
        exclude: ^archive/
      - id: fix-byte-order-marker
        exclude: ^archive/
      - id: mixed-line-ending # replaces or checks mixed line ending.
        exclude: ^archive/
      - id: check-merge-conflict # checks for files that contain merge conflict strings.
        exclude: ^archive/
      - id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
        exclude: ^archive/
      - id: check-executables-have-shebangs # ensures that (non-binary) executables have a shebang.
        exclude: (^archive/|^website\/public)
      - id: check-shebang-scripts-are-executable # ensures that (non-binary) files with a shebang are executable.
        exclude: (^archive/|^website\/public)
      - id: check-docstring-first
        exclude: ^archive/
      - id: check-symlinks
        exclude: ^archive/
      - id: destroyed-symlinks
        exclude: ^archive/
      - id: fix-byte-order-marker # removes utf-8 byte order marker.
        exclude: ^archive/
      - id: requirements-txt-fixer # sorts entries in requirements.txt.
        exclude: ^archive/
      - id: check-added-large-files # prevents giant files from being committed.
        exclude: \.(png|jpg|jpeg|svg|yaml|yml|tpl|md)$
      - id: check-yaml # checks yaml files for parseable syntax.
        exclude: (^archive|^website\/public|templates\/.*|crds\/.*|questions.yaml|chart_schema.yaml|common-test\/.*\.yaml|^clustertool)
      - id: detect-private-key # detects the presence of private keys.
        exclude: ^archive/

  - repo: https://github.com/pre-commit/pygrep-hooks
    rev: v1.10.0
    hooks:
      - id: text-unicode-replacement-char
        exclude: ^archive/
      - id: rst-backticks
        exclude: ^archive/
