Skip to content

fix(hooks): per-part command checks, project-only formatting; README and changelog - #1

Merged
jvitorcosta merged 2 commits into
mainfrom
fix/hooks-and-polish
Oct 28, 2026
Merged

jvitorcosta merged 2 commits into
mainfrom
fix/hooks-and-polish

Conversation

@jvitorcosta

Copy link
Copy Markdown
Owner

Fixed

  • validate_bash.py checked the whole command line, so a push to a feature branch followed by gh pr create --base main was blocked as a push to main, and an unrelated rm -f after a push as a force push. It now splits the line into its parts and parses the push's refspecs, which also catches git push origin HEAD:main, feature:refs/heads/main and forced +ref pushes that the old regex missed.
  • format_python.py reformatted any edited .py file, even in other repos, with this project's ruff config. It now only touches .py/.pyi files inside CLAUDE_PROJECT_DIR.
  • The template's Makefile overrode Windows' TMP variable for every command it ran; the variable is now OUT.

Added

  • tests/test_hooks.py (33 cases) and make test-hooks, part of make test and CI.
  • README: badges, pitch and copy command up front, the tree of a generated project. CHANGELOG.md for the template.

Changed

  • Default author: Vitor Pinheiro.

make test passes locally: hook tests, then both rendered variants (ruff, mypy, pytest). After merging, tagging v0.3.0 lets existing projects get the fixes with uvx copier update.

🤖 Generated with Claude Code

…oject

validate_bash.py checked the whole command line, so a push to a feature
branch followed by a gh pr create with --base main was blocked as a push
to main, and a push followed by an unrelated rm with -f as a force push.
It now splits the line into its parts, parses the push refspecs (also
catching HEAD:main and +ref) and checks the other rules per part.

format_python.py formatted any edited .py file, even in other repos, with
this project's ruff config. It now only touches .py/.pyi files inside
CLAUDE_PROJECT_DIR.

Also: tests for both hooks (make test-hooks, part of make test), the
Makefile's TMP variable renamed to OUT (it overrode Windows' temp folder
for every command make ran), default author Vitor Pinheiro.
README opens with badges, the pitch and the one-line copy command, shows
the tree of a generated project and describes what each hook does.
CHANGELOG.md records v0.1.0 to v0.2.0 and the unreleased hook fixes.
CONTRIBUTING mentions make test-hooks.
@jvitorcosta
jvitorcosta merged commit 14f5ca9 into main Oct 28, 2026
3 checks passed
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