ci:
  autoupdate_commit_msg: "ci: autoupdate pre-commit hooks"
  autoupdate_schedule: quarterly
  skip:
    # local hooks
    - flake8
    - pylint
  submodules: true

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.0.1
    hooks:
      - id: check-case-conflict
      - id: end-of-file-fixer
      - id: mixed-line-ending
      - id: requirements-txt-fixer
      - id: trailing-whitespace

  - repo: https://github.com/psf/black
    rev: 21.9b0
    hooks:
      - id: black

  - repo: https://github.com/streetsidesoftware/cspell-cli
    rev: v5.6.10
    hooks:
      - id: cspell

  - repo: https://github.com/myint/docformatter
    rev: v1.4
    hooks:
      - id: docformatter
        args:
          - --in-place
          - --wrap-descriptions=79
          - --wrap-summaries=79

  - repo: https://github.com/pycqa/isort
    rev: 5.9.3
    hooks:
      - id: isort

  - repo: https://github.com/igorshubovych/markdownlint-cli
    rev: v0.29.0
    hooks:
      - id: markdownlint

  - repo: https://github.com/nbQA-dev/nbQA
    rev: 1.1.1
    hooks:
      - id: nbqa-black
      - id: nbqa-isort

  - repo: https://github.com/kynan/nbstripout
    rev: 0.5.0
    hooks:
      - id: nbstripout

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v2.4.1
    hooks:
      - id: prettier

  # The following tools have to be install locally, because they can also be
  # used by code editors (e.g. linting and format-on-save).

  - repo: local
    hooks:
      - id: flake8
        name: flake8
        entry: flake8
        language: system
        types:
          - python

      - id: pylint
        name: pylint
        entry: pylint
        args:
          - --rcfile=.pylintrc
          - --score=no
        language: system
        types:
          - python
