Files
rsspipe/scripts/check.sh
T
haopengzhan d7ed8876dc
CI Quality Checks & Tests / Frontend Typecheck & Build (push) Successful in 1m28s
CI Quality Checks & Tests / Gitleaks Secret Detection (push) Failing after 3m29s
CI Quality Checks & Tests / Go Lint & Unit Tests (push) Failing after 3h12m8s
fix: resolve all golangci-lint errors and integrate linter into CI/CD, Makefile, and check script
2026-08-24 21:46:52 -07:00

48 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "=================================================="
echo " Running RSSPipe Quality Checks "
echo "=================================================="
echo "==> 1. Checking Go formatting (gofmt)..."
UNFORMATTED=$(gofmt -l internal/ cmd/)
if [ -n "$UNFORMATTED" ]; then
echo "ERROR: The following Go files are not formatted properly:"
echo "$UNFORMATTED"
echo "Run: gofmt -w internal/ cmd/"
exit 1
fi
echo "✓ Go files formatted correctly."
echo "==> 2. Running Go vet & golangci-lint..."
go vet ./...
if command -v golangci-lint &> /dev/null; then
golangci-lint run
echo "✓ golangci-lint passed (0 issues)."
else
echo "⚠ golangci-lint not installed locally (will run in CI)."
fi
echo "==> 3. Running Go tests..."
go test -v ./...
echo "✓ Go tests passed."
echo "==> 4. Building React Frontend (TypeScript + Vite)..."
cd web
npm run build
cd ..
echo "✓ Frontend build passed."
echo "==> 5. Running Secret Leak Scan (Gitleaks)..."
if command -v gitleaks &> /dev/null; then
gitleaks detect --no-git --source . -c .gitleaks.toml -v
echo "✓ Gitleaks scan passed."
else
echo "⚠ Gitleaks not installed locally, skipping local binary check (will run in CI)."
fi
echo "=================================================="
echo " 🎉 All RSSPipe checks passed cleanly! "
echo "=================================================="