repos:
  # General file checks
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: check-executables-have-shebangs
      - id: check-json
      - id: check-added-large-files
        args: ['--maxkb=500']
        exclude: '^schemas/'
      - id: check-merge-conflict
      - id: check-shebang-scripts-are-executable
      - id: check-symlinks
      - id: check-toml
      - id: check-yaml
        args: [--allow-multiple-documents]
      - id: detect-aws-credentials
        args: [--allow-missing-credentials]
      - id: detect-private-key
      - id: end-of-file-fixer
      - id: forbid-new-submodules
      - id: pretty-format-json
        args: ['--autofix']
      - id: trailing-whitespace

  # YAML linting
  - repo: https://github.com/adrienverge/yamllint.git
    rev: v1.37.1
    hooks:
      - id: yamllint
        args:
          [
            "-d {extends: relaxed, rules: {line-length: disable}, ignore: chart}",
            "-s",
          ]

  # Kubernetes manifest validation
  - repo: local
    hooks:
      - id: no_plain_secrets
        name: prevent plain kubernetes secrets
        entry: ci/validate-no-secrets.sh
        language: system
        pass_filenames: false
