Integrated repository, worktree, git stacker, and project manager
0

Configure Feed

Select the types of activity you want to include in your feed.

add a project pre-commit hook that runs make lint

`make hooks-install` points `core.hooksPath` at `.githooks/` so commits
run lint locally. The hook chains to `$PM_PRE_COMMIT_CHAIN/pre-commit`
when set so a global Databricks pre-commit still gets to run its
secret-scan / commit-msg checks.

The lint target now exits with an explicit "don't use noqa / type:
ignore to silence" hint so contributors fix the underlying issue
instead of suppressing the warning.

Jordan Isaacs (May 15, 2026, 5:10 PM UTC) 320cf618 5b46b216

+46 -2
+25 -2
Makefile
··· 1 - .PHONY: check lint typecheck test test-emacs fmt 1 + .PHONY: check lint typecheck test test-emacs fmt hooks-install hooks-uninstall 2 2 3 3 check: lint typecheck test test-emacs 4 4 5 5 lint: 6 - uv run ruff check src tests 6 + @uv run ruff check src tests || { \ 7 + echo ""; \ 8 + echo "lint failed — don't use noqa / type: ignore to silence."; \ 9 + echo "fix the underlying issue (rename, split, narrow types, etc.)."; \ 10 + exit 1; \ 11 + } 7 12 8 13 typecheck: 9 14 uv run ty check src tests ··· 19 24 fmt: 20 25 uv run ruff format src tests 21 26 uv run ruff check --fix --unsafe-fixes src tests 27 + 28 + # Pre-commit hook setup. 29 + # 30 + # `core.hooksPath` is the only way to install a hook in a worktree (no 31 + # `.git/hooks` directory there). If you already have a global 32 + # `core.hooksPath` (e.g. Databricks corporate hooks), our 33 + # `.githooks/pre-commit` chains to it via the `$PM_PRE_COMMIT_CHAIN` 34 + # env var so the upstream secret-scan / commit-msg checks still run — 35 + # point that env var at the global hook's directory before committing. 36 + hooks-install: 37 + git config core.hooksPath .githooks 38 + @echo "pre-commit hook installed (runs 'make lint')." 39 + @echo "If you had a global core.hooksPath, set PM_PRE_COMMIT_CHAIN=<old path>" 40 + @echo "in your shell so .githooks/pre-commit chains to it." 41 + 42 + hooks-uninstall: 43 + git config --unset core.hooksPath || true 44 + @echo "pre-commit hook removed."
+21
.githooks/pre-commit
··· 1 + #!/usr/bin/env bash 2 + # Project pre-commit hook. 3 + # 4 + # Runs `make lint` against the whole tree. Chains to a previous hooks 5 + # directory if `$PM_PRE_COMMIT_CHAIN` is set so a global Databricks (or 6 + # similar) pre-commit can still run its secret-scan and friends. 7 + # 8 + # Install with `make hooks-install` (sets `core.hooksPath` to `.githooks`). 9 + set -euo pipefail 10 + 11 + repo_root="$(git rev-parse --show-toplevel)" 12 + 13 + if [[ -n "${PM_PRE_COMMIT_CHAIN:-}" ]]; then 14 + chained="${PM_PRE_COMMIT_CHAIN%/}/pre-commit" 15 + if [[ -x "$chained" ]]; then 16 + "$chained" "$@" 17 + fi 18 + fi 19 + 20 + cd "$repo_root" 21 + make lint