fix: share CI quality gates with husky hooks - #133
Merged
Conversation
Use yarn lint-staged, cover tsx/jsx, run yarn lint (not only lint:fix), and regenerate README when codemod.yaml files are staged so pre-commit catches the failures that were only showing up in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
Extract scripts/check-changed.sh as the single source of truth for format/lint/package-name/test/README checks. CI and husky pre-push both call it; pre-commit fails loudly without yarn install so hooks cannot be skipped silently. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
scripts/check-changed.shas the single source of truth for changed-file quality gates (format, lint, package name length, package tests, README freshness).github/workflows/ci.yml) and husky pre-push both run that script — local and remote cannot driftyarn lint-stagedwith CI-aligned globs (tsx/jsx,yarn lint, README regen oncodemod.yamlchanges)node_modules/ lint-staged is missing (no more silent skip in worktrees)Why
MUI→BUI consistency commits landed with CI-only failures because:
core.hooksPathwas unset withoutyarn install, so husky never rantsx,lint:fixonly, no README check)This is the permanent wiring, not a one-off workaround.
Test plan
yarn check:changed origin/mainpasses on this branchyarn install, confirm commit fails with a clear error after hooks are configured on the clone