We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jbrinkman/valkey-ai-tasks'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
pre-commit•1.02 kB
#!/bin/bash
# Pre-commit hook to run golangci-lint on changed Go files
# Create a list of staged Go files
STAGED_GO_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep "\.go$")
# Exit if no Go files are staged
if [[ "$STAGED_GO_FILES" = "" ]]; then
echo "No Go files staged for commit. Skipping linting."
exit 0
fi
# Check if golangci-lint is installed
if ! command -v golangci-lint &> /dev/null; then
echo "golangci-lint not found. Installing..."
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
fi
echo "Running golangci-lint on staged Go files..."
# Run golangci-lint on staged files
LINT_ERRORS=0
for FILE in $STAGED_GO_FILES; do
golangci-lint run "$FILE"
if [ $? -ne 0 ]; then
LINT_ERRORS=1
fi
done
# If there are errors, abort the commit
if [ $LINT_ERRORS -ne 0 ]; then
echo "❌ golangci-lint found issues. Please fix them before committing."
exit 1
fi
echo "✅ No linting issues found."
exit 0