chore: replace husky with lefthook#776
Open
shottah wants to merge 1 commit into
Open
Conversation
Switch the git hook manager from husky to lefthook to fix the two-commit-required workflow described in celo-org#691. Husky's pre-commit ran `yarn fmt --staged`, which formatted files in the working tree but did not re-add them to the git index, so contributors had to make a second commit to include the formatting fixes. Lefthook's `stage_fixed: true` option re-stages files that hooks modify, so a single commit now lands the formatted output. Per the Biome git-hooks recipe, the pre-commit also upgrades from `format --write` to `check --write`, which runs lint + format in one pass over staged files. The pre-push hook is preserved verbatim (prereleasecheck.sh). Closes celo-org#691
|
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.
Closes #691.
Replaces husky with lefthook so pre-commit formatting fixes are auto-restaged (
stage_fixed: true) and onegit commitis enough. Follows Biome's git hooks recipe.Changes
package.json: swaphuskyforlefthook, pointpostinstallatlefthook install.lefthook.yml: pre-commit runsbiome check --writeon staged files +prereleasecheck.sh; pre-push keepsprereleasecheck.sh..husky/removed.No changeset (dev tooling only).
Test plan