Proposing adding a .pre-commit-config.yaml to the root of the repository. This would allow developers to run formatters and linters automatically before committing their changes, catching issues locally and reducing CI noise.
Here is a sample configuration matching the project's current tooling:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
# Matches black line-length = 100 configuration in pyproject.toml
args: [--line-length=100]
- repo: https://github.com/pypa/validate-pyproject
rev: v0.18
hooks:
- id: validate-pyproject
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies: [types-freezegun]
files: ^(src/|tests/)
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
files: ^src/
Proposing adding a
.pre-commit-config.yamlto the root of the repository. This would allow developers to run formatters and linters automatically before committing their changes, catching issues locally and reducing CI noise.Here is a sample configuration matching the project's current tooling: