repos:
  # other fast helpful checks
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
      - id: check-yaml
        args: [--allow-multiple-documents]
      - id: check-json
      - id: end-of-file-fixer
      - id: trailing-whitespace
        exclude: ^manifests/gcp_marketplace/test/*
      - id: debug-statements
      - id: check-merge-conflict
      - id: name-tests-test
      - id: double-quote-string-fixer
      - id: no-commit-to-branch
        args: [--branch, master]
  # required formatting jobs (run these last)

  # add comment "noqa" to ignore an import that should not be removed
  # (e.g., for an import with desired side-effects)
  - repo: https://github.com/hadialqattan/pycln
    rev: v2.1.1
    hooks:
      - id: pycln
        name: pycln
        language: python
        entry: pycln --all
  - repo: https://github.com/pycqa/isort
    rev: 5.11.5
    hooks:
      - id: isort
        name: isort
        entry: isort --profile google
  - repo: https://github.com/pre-commit/mirrors-yapf
    rev: "v0.32.0"
    hooks:
      - id: yapf
  - repo: https://github.com/pycqa/docformatter
    rev: v1.4
    hooks:
      - id: docformatter
        name: docformatter
        language: python
        entry: docformatter -i -r
        # docformatter messes up certain sphinx link formatting.
        # The kubernetes_platform/python docstrings are heavy on links, so ignore.
        exclude: (sdk/python/kfp/compiler/compiler_test.py|kubernetes_platform/python/)
