ktx/.pre-commit-config.yaml
Andrey Avtomonov 8ebc4ce107
ci: stop tombi reformatting uv.lock and sync lock to 0.7.0 (#235)
The pre-commit job failed because tombi-format reformats uv.lock to a
layout uv does not produce, so once CI's uv sync re-resolved the stale
lock (workspace members still at 0.6.0) and rewrote it, tombi rewrote it
back and the hook reported a modified file.

Exclude uv.lock from tombi-format so uv stays authoritative for its
generated lockfile, and bump the workspace members to 0.7.0 so the lock
is current and uv stops re-resolving it (uv lock --check now passes).
2026-05-29 15:04:48 +02:00

92 lines
2.7 KiB
YAML

# See https://pre-commit.com for hook documentation.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
- repo: https://github.com/tombi-toml/tombi-pre-commit
rev: v1.1.0
hooks:
- id: tombi-format
args: ["--offline"]
# uv.lock is generated and owned by uv, which writes its own canonical
# TOML layout. tombi reformats that layout differently, so once uv
# regenerates the lock (e.g. after a dependency or version change)
# tombi rewrites it and the hook fails on the modified file. Keep uv
# authoritative for its lockfile; tombi still formats hand-edited TOML.
exclude: ^uv\.lock$
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
name: pyupgrade (python)
files: ^python/
args: [--py313-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.2
hooks:
- id: ruff
name: ruff (python)
files: ^python/
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
name: ruff format (python)
files: ^python/
- repo: local
hooks:
- id: biome-dead-code
name: biome dead-code check
entry: pnpm exec biome ci . --formatter-enabled=false --assist-enabled=false
language: system
pass_filenames: false
- id: knip-dead-code
name: knip dead-code (auto-fix)
entry: pnpm exec knip --fix --reporter compact
language: system
pass_filenames: false
- id: knip-dead-code-production
name: knip dead-code (production mode)
entry: pnpm exec knip --production --reporter compact
language: system
pass_filenames: false
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
exclude: |
(?x)^(
.*\.lock$|
.*pnpm-lock\.yaml$|
.*package-lock\.json$|
.*yarn\.lock$|
.*\.log$|
.*\.dump$|
.*\.sql$|
.*\.csv$|
.*\.db$|
.*\.sqlite$|
.*\.sqlite3$|
.*/node_modules/.*|
.*/\.venv/.*|
.*/dist/.*|
.*/build/.*|
.*/coverage/.*|
.*/htmlcov/.*|
.*\.gen\.ts$|
.*\.gen\.py$|
.*\.generated\.ts$
)$