Repository navigation
fix(hooks): per-part command checks, project-only formatting; README and changelog - #1
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed
gh pr create --base mainwas blocked as a push to main, and an unrelatedrm -fafter a push as a force push. It now splits the line into its parts and parses the push's refspecs, which also catchesgit push origin HEAD:main,feature:refs/heads/mainand forced+refpushes that the old regex missed..pyfile, even in other repos, with this project's ruff config. It now only touches.py/.pyifiles insideCLAUDE_PROJECT_DIR.TMPvariable for every command it ran; the variable is nowOUT.Added
tests/test_hooks.py(33 cases) andmake test-hooks, part ofmake testand CI.CHANGELOG.mdfor the template.Changed
make testpasses locally: hook tests, then both rendered variants (ruff, mypy, pytest). After merging, tagging v0.3.0 lets existing projects get the fixes withuvx copier update.🤖 Generated with Claude Code