exclude: "/migrations/|^venv/|/email/subject/"
default_stages: [pre-commit]

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace
        name: Drop trailing whitespace
        exclude: man
      - id: end-of-file-fixer
        name: Fix end of files
      - id: check-yaml
        name: Check YAML syntax
      - id: check-toml
        name: Check TOML syntax
      # - id: pretty-format-json
      #   name: Format JSON
      - id: check-added-large-files
        name: Prevent adding large files
        args: ['--maxkb=1024']
      - id: check-merge-conflict
        name: Check for unhandled merge conflicts
      - id: debug-statements
        name: Check for debug statements
      - id: detect-private-key
        name: Detect private keys

  # https://lorenzwalthert.github.io/precommit/articles/available-hooks.html
  - repo: https://github.com/lorenzwalthert/precommit
    rev: v0.4.3.9001
    hooks:
      - id: style-files
        name: Style code to tidyverse conventions
        args: [--scope=spaces]
      - id: readme-rmd-rendered
        name: Ensure README.md is up to date
      - id: no-debug-statement
        name: Ensure that no debug() statement is committed
      - id: no-browser-statement
        name: Ensure that no browser() statement is committed
      # - id: spell-check
      #   name: Spellcheck
      # - id: deps-in-desc
      #   name: Ensure that DESCRIPTION lists all dependencies
      #   args: [--allow_private_imports, --root=R]
      - id: use-tidy-description
        name: Format DESCRIPTION
      # - id: pkgdown
      #   name: Validate pkgdown.yml
    #   - id: lintr
    #     name: Lint code but emit only warnings
    #     args: [--warn_only]
    #     verbose: true
