Skip to content

chore: guard lint-staged pre-commit hook - #1151

Draft
CleanDev-Fix wants to merge 1 commit into
LabsCrypt:mainfrom
CleanDev-Fix:infra/1077-lint-staged-guard
Draft

chore: guard lint-staged pre-commit hook#1151
CleanDev-Fix wants to merge 1 commit into
LabsCrypt:mainfrom
CleanDev-Fix:infra/1077-lint-staged-guard

Conversation

@CleanDev-Fix

Copy link
Copy Markdown

Summary

Make the pre-commit hook fail clearly when lint-staged is not installed locally.

Changes

  • Guard the repository-local lint-staged executable before invocation.
  • Direct contributors to run npm install when it is missing.
  • Invoke the local executable directly, avoiding npx package resolution.
  • Leave the existing lint-staged scope unchanged.

Testing / Verification

  • sh -n .husky/pre-commit
  • Isolated missing-binary scenario: exact guidance message and exit 1.
  • Isolated present-binary scenario with npx unavailable: local binary
    invoked and exit 0.
  • Isolated failing-binary scenario: exit status propagated.
  • git diff --check

Related issue: #1077

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