Files
dance-lessons-coach/.vibe/skills/commit_message/assets/git-hooks
Gabriel Radureau 7c8c821f66
Some checks failed
Go CI/CD Pipeline / Build and Test (push) Successful in 4m26s
Docker Build and Publish / Version Bump (push) Successful in 10m6s
Go CI/CD Pipeline / Lint and Format (push) Successful in 10m33s
Go CI/CD Pipeline / Version Management (push) Successful in 25s
Main Branch CI/CD (Optimized) / Build and Test (push) Failing after 4m2s
Main Branch CI/CD (Optimized) / Lint and Format (push) Successful in 4m41s
Main Branch CI/CD (Optimized) / Version Management and Docker Build (push) Has been skipped
Docker Build and Publish / Build and Push Docker Image (push) Failing after 5m1s
feat: enhance commit message skill with issue reference suggestions (related to #2)
2026-04-06 16:06:42 +02:00
..

Git Hooks for DanceLessonsCoach

This directory contains Git hooks for the DanceLessonsCoach project.

Available Hooks

pre-commit

  • Location: .git/hooks/pre-commit
  • Purpose: Automatically runs go mod tidy and go fmt before commits
  • Features:
    • Runs go mod tidy to clean up dependencies
    • Automatically adds modified go.mod and go.sum to commit
    • Runs go fmt on staged Go files only
    • Automatically adds formatted files to commit
    • Only runs if in a Go project (checks for go.mod)

Installation

The pre-commit hook is already installed and executable. No additional setup required.

Usage

The hooks run automatically when you commit:

git add .
git commit -m "✨ feat: add new feature"

The hook will:

  1. Run go mod tidy
  2. Run go fmt on all Go files
  3. Add any modified files to your commit
  4. Allow the commit to proceed if successful

Customization

To modify the hooks:

  1. Edit the hook file in .git/hooks/
  2. Make it executable: chmod +x .git/hooks/hook-name

Disabling Hooks

To temporarily disable hooks:

# Skip pre-commit hook for one commit
git commit --no-verify -m "✨ feat: add new feature"

Best Practices

  • Let the hooks run automatically - they ensure code quality
  • The hooks only modify files that need changes
  • All changes are added to your commit automatically
  • Hooks run quickly and prevent common issues

Troubleshooting

If a hook fails:

  • Check the error message
  • Fix the issue manually
  • Commit again

Common issues:

  • go mod tidy fails: Check your Go module dependencies
  • go fmt fails: Check for syntax errors in your Go code