Skill Improvements: - BDD Testing Skill: Enhanced step templates, debugging guides, and patterns - Gitea Client Skill: Added wiki management, issue tracking, and workflow monitoring - Product Owner Assistant: Improved user story workflow and documentation - Commit Message Skill: Better gitmoji integration and issue referencing - Changelog Manager: Enhanced change tracking and documentation - Skill Creator: Improved skill generation templates and validation - Swagger Documentation: Updated OpenAPI integration guides Key Features: - BDD best practices documentation - Gitea API client with wiki support - User story implementation workflow - Git commit message standardization - Skill development patterns - OpenAPI/Swagger documentation generation Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
50 lines
1.3 KiB
Bash
Executable File
50 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# dance-lessons-coach pre-commit hook
|
|
# Runs go mod tidy, go fmt, and suggests issue references before allowing commits
|
|
|
|
echo "Running pre-commit hooks..."
|
|
|
|
# Suggest issue references first (before any changes)
|
|
if [ -f ".vibe/skills/commit_message/scripts/suggest-issue-reference.sh" ]; then
|
|
echo "Checking for relevant issues..."
|
|
./.vibe/skills/commit_message/scripts/suggest-issue-reference.sh || true
|
|
echo ""
|
|
fi
|
|
|
|
# Check if we're in a Go project
|
|
if [ ! -f "go.mod" ]; then
|
|
echo "Not a Go project, skipping Go-specific hooks"
|
|
exit 0
|
|
fi
|
|
|
|
# Run go mod tidy
|
|
echo "Running go mod tidy..."
|
|
go mod tidy
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR: go mod tidy failed"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if go.mod or go.sum were modified
|
|
if git diff --cached --name-only | grep -qE '(go\.mod|go\.sum)'; then
|
|
echo "go.mod or go.sum changed, adding to commit..."
|
|
git add go.mod go.sum
|
|
fi
|
|
|
|
# Run go fmt on staged Go files only
|
|
echo "Running go fmt on staged files..."
|
|
STAGED_GOFILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$')
|
|
if [ -n "$STAGED_GOFILES" ]; then
|
|
gofmt -w $STAGED_GOFILES
|
|
if [ $? -ne 0 ]; then
|
|
echo "ERROR: go fmt failed"
|
|
exit 1
|
|
fi
|
|
|
|
# Add formatted files to commit
|
|
git add $STAGED_GOFILES
|
|
fi
|
|
|
|
echo "Pre-commit hooks completed successfully"
|
|
exit 0 |