chore: Add pre-commit blocker report and improve Go version management
- Created a comprehensive pre-commit blocker report detailing GolangCI-Lint and TypeScript type check failures, including remediation steps and verification commands. - Enhanced the golangci-lint pre-commit hook to automatically rebuild the tool if a Go version mismatch is detected. - Introduced a new script `rebuild-go-tools.sh` to rebuild essential Go development tools, ensuring they are compiled with the current Go version. - Improved error handling and user feedback in the rebuilding process, providing clear instructions for manual intervention if needed. - Updated supervisor review report to reflect the successful implementation of Go version management and associated documentation.
This commit is contained in:
@@ -69,3 +69,48 @@ if [[ "$NEW_VERSION" != "$REQUIRED_VERSION" ]]; then
|
||||
echo "⚠️ Warning: Installed version ($NEW_VERSION) doesn't match required ($REQUIRED_VERSION)"
|
||||
echo " You may need to restart your terminal or IDE"
|
||||
fi
|
||||
|
||||
# Phase 1: Rebuild critical development tools with new Go version
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "🔧 Rebuilding development tools with Go $REQUIRED_VERSION..."
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo ""
|
||||
|
||||
# List of critical tools to rebuild
|
||||
TOOLS=(
|
||||
"github.com/golangci/golangci-lint/cmd/golangci-lint@latest"
|
||||
"golang.org/x/tools/gopls@latest"
|
||||
"golang.org/x/vuln/cmd/govulncheck@latest"
|
||||
)
|
||||
|
||||
FAILED_TOOLS=()
|
||||
|
||||
for tool in "${TOOLS[@]}"; do
|
||||
tool_name=$(basename "$(dirname "$tool")")
|
||||
echo "📦 Installing $tool_name..."
|
||||
|
||||
if go install "$tool" 2>&1; then
|
||||
echo "✅ $tool_name installed successfully"
|
||||
else
|
||||
echo "❌ Failed to install $tool_name"
|
||||
FAILED_TOOLS+=("$tool_name")
|
||||
fi
|
||||
echo ""
|
||||
done
|
||||
|
||||
if [ ${#FAILED_TOOLS[@]} -eq 0 ]; then
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "✅ All tools rebuilt successfully!"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
else
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "⚠️ Some tools failed to install:"
|
||||
for tool in "${FAILED_TOOLS[@]}"; do
|
||||
echo " - $tool"
|
||||
done
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo ""
|
||||
echo "You can manually rebuild tools later with:"
|
||||
echo " ./scripts/rebuild-go-tools.sh"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user