mirror of
https://github.com/cloudflare/cloudflared.git
synced 2026-06-23 04:10:20 +00:00
f827e6216b
Adding pre-push hooks to cloudflared. While developing in cloudflared, I found myself constantly bumping into issues in CI, as I was forgetting to run linters and tests at times. We should run these before pushing any code to our repo.
30 lines
570 B
Bash
Executable File
30 lines
570 B
Bash
Executable File
#!/bin/sh
|
|
# Pre-push hook for cloudflared
|
|
# Runs linting and tests before allowing pushes
|
|
|
|
set -e
|
|
|
|
echo "========================================"
|
|
echo "Running pre-push checks..."
|
|
echo "========================================"
|
|
|
|
# Run formatting check
|
|
echo ""
|
|
echo "==> Checking formatting..."
|
|
make fmt-check
|
|
|
|
# Run linter
|
|
echo ""
|
|
echo "==> Running linter..."
|
|
make lint
|
|
|
|
# Run tests
|
|
echo ""
|
|
echo "==> Running tests..."
|
|
make test
|
|
|
|
echo ""
|
|
echo "========================================"
|
|
echo "All pre-push checks passed!"
|
|
echo "========================================"
|