Skip to content

Add ruff lint/format with git + Claude hooks#52

Merged
thavelick merged 3 commits into
mainfrom
add_ruff_lint_format
May 11, 2026
Merged

Add ruff lint/format with git + Claude hooks#52
thavelick merged 3 commits into
mainfrom
add_ruff_lint_format

Conversation

@thavelick

@thavelick thavelick commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add `make lint`, `make format`, `make install-hooks` targets (uvx ruff)
  • Versioned pre-commit hook at `tools/git-hooks/pre-commit` (execs `make lint`)
  • Claude PostToolUse hook in `.claude/settings.json` auto-formats `.py` files after Edit/Write/MultiEdit
  • One-time `ruff format` pass across `application/`, `scripts/`, `tests/`

Pattern mirrors `../dotfiles` Python conventions, but invokes ruff via `uvx` so no project dependency is added.

Test plan

  • `make lint` passes
  • `make install-hooks` sets `core.hooksPath` to `tools/git-hooks`
  • `make test-unit` and `make test-integration` pass
  • Pre-commit hook blocks a commit with a deliberate ruff violation
  • Claude editing a `.py` file auto-formats on save

🤖 Generated with Claude Code

thavelick and others added 3 commits May 10, 2026 23:57
Wires up ruff via uvx for lint and format check (make lint), auto-format
(make format), a versioned pre-commit hook in tools/git-hooks/, and a
Claude PostToolUse hook that formats .py files after edits. Includes
one-time ruff format pass across the repo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Integration tests check generated public_html files which require make
freeze and aren't needed for code-correctness commit gating; keep them
for CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Catches ruff violations even if a contributor skips the pre-commit hook
or hasn't run make install-hooks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thavelick thavelick merged commit dae57ff into main May 11, 2026
2 checks passed
@thavelick thavelick deleted the add_ruff_lint_format branch May 11, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant