diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4f31210..ed92440 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,29 +1,34 @@ repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - # Ruff version. - rev: v0.9.6 - hooks: - # Run the linter. - - id: ruff - args: [ --fix ] - # Run the formatter. - - id: ruff-format - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 - hooks: - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: local - hooks: - # Run mypy through our wrapper script in order to get the possible - # pyenv and/or virtualenv activated; it may not have been e.g. if - # committing from a GUI tool that was not launched from an activated - # shell. - - id: mypy - name: mypy - entry: scripts/run-in-env.sh mypy --strict - language: script - types: [python] - require_serial: true - files: ^(src)/.+\.py$ +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: check-added-large-files + - id: check-merge-conflict + - id: check-shebang-scripts-are-executable + - id: check-docstring-first + - id: debug-statements + - id: check-ast + - id: check-json + - id: check-toml + - id: check-xml + - id: check-yaml + args: ['--unsafe'] # needed for !! tags in mkdocs.yml + - id: end-of-file-fixer + - id: mixed-line-ending + args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows + +# Ruff replaces black, flake8, autoflake, isort and more +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.9.7' # make sure this is always consistent with hatch configs + hooks: + - id: ruff + - id: ruff-format + args: [--check, --config, ./pyproject.toml] + +- repo: https://github.com/pre-commit/mirrors-mypy + rev: 'v1.15.0' # make sure this is always consistent with hatch configs + hooks: + - id: mypy + args: ["--install-types", "--non-interactive", "--ignore-missing-imports"] + additional_dependencies: [types-tabulate, types-cachetools]