Add pre-commit

This commit is contained in:
Matt Borgerson
2026-01-10 21:14:13 -07:00
parent b035aff299
commit 8043003e86

94
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,94 @@
repos:
#
# Fail fast
#
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
fail_fast: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# General
- id: check-merge-conflict
fail_fast: true
- id: check-case-conflict
fail_fast: true
- id: destroyed-symlinks
fail_fast: true
- id: check-symlinks
fail_fast: true
- id: check-added-large-files
fail_fast: true
# Syntax
- id: check-toml
fail_fast: true
- id: check-json
fail_fast: true
- id: check-yaml
fail_fast: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-ast
fail_fast: true
#
# Modifiers
#
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/dannysepler/rm_unneeded_f_str
rev: v0.2.0
hooks:
- id: rm-unneeded-f-str
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py38-plus]
# Last modifier: Coding Standard
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
hooks:
- id: black
#
# Static Checks
#
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
# Python
- id: python-use-type-annotations
- id: python-no-log-warn
# Documentation
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: debug-statements
- id: check-builtin-literals
- id: check-docstring-first
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff