ci:
  autofix_prs: false
  autoupdate_schedule: monthly

repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v4.5.0
  hooks:
  - id: check-ast
  - id: trailing-whitespace
  - id: end-of-file-fixer
    exclude: .*\.fits
  - id: check-merge-conflict
    exclude: .*\.rst
  - id: requirements-txt-fixer
  - id: check-symlinks
  - id: check-case-conflict
  - id: check-json
  - id: check-toml
  - id: check-yaml

- repo: https://github.com/tox-dev/pyproject-fmt
  rev: 1.5.3
  hooks:
  - id: pyproject-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.1.6
  hooks:
  - id: ruff
    args: [--fix]

- repo: https://github.com/PyCQA/isort
  rev: 5.12.0
  hooks:
  - id: isort
    name: isort
    entry: isort
    require_serial: true
    language: python
    types:
    - python

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

- repo: https://github.com/nbQA-dev/nbQA
  rev: 1.7.1
  hooks:
  - id: nbqa-black
    additional_dependencies:
    - black==23.3.0
    args:
    - --nbqa-mutate
  - id: nbqa-isort
    additional_dependencies:
    - isort==5.12.0
    args:
    - --nbqa-mutate

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
  rev: v2.11.0
  hooks:
  - id: pretty-format-ini
    args: [--autofix]
  - id: pretty-format-yaml
    args: [--autofix]

- repo: https://github.com/MarcoGorelli/absolufy-imports
  rev: v0.3.1
  hooks:
  - id: absolufy-imports
    exclude: docs/plasmapy_sphinx

- repo: https://github.com/codespell-project/codespell
  rev: v2.2.6
  hooks:
  - id: codespell
    exclude: .*\.fits
    additional_dependencies:
    - tomli

- repo: https://github.com/asottile/pyupgrade
  rev: v3.15.0
  hooks:
  - id: pyupgrade
    args: [--keep-runtime-typing, --py39-plus]
    files: ^xrtpy/

- repo: https://github.com/pre-commit/pygrep-hooks
  rev: v1.10.0
  hooks:
  - id: rst-directive-colons
  - id: rst-inline-touching-normal
