Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 33 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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]