ktx/.pre-commit-config.yaml
Andrey Avtomonov b690e6988b chore(workspace): gate dead-code with knip production mode
Turn on production-mode knip plus an autofix run in pre-commit and the
`pnpm dead-code` script, document the `/** @internal */` convention for
test-only exports in AGENTS.md, annotate test-only exports across the
CLI with that JSDoc, and drop dead exports/wrappers the new gate
surfaced (e.g. `cli-project.ts`, `lookerRuntimeSourceToFileAdapterSource`,
`createLocalScanEnrichmentProvidersFromConfig`,
`PGLITE_OWNER_PROCESS_BACKEND_CAPABILITIES`, stale type re-exports).
Replace the loose `ignoreIssues` allowlist in `knip.json` with explicit
production entries so cross-package barrel leaks are caught.
2026-05-21 11:35:41 +02:00

80 lines
2.1 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/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$
)$