You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add git pre-commit hook for automatic code formatting (#23384)
Add a Husky-based pre-commit hook that runs Spotless on staged files, so code is automatically formatted before each commit.
- Use Husky (via npx) for cross-platform git hook management
- Auto-install hooks via Maven profile activated when .husky/_ is missing
- Use ratchetFrom with the upstream merge-base to only format changed files
- Stash unstaged changes before formatting to preserve partial staging
- Use a filesystem lock to prevent races during parallel Maven builds
- Skip formatting during rebase when no upstream is set
0 commit comments