Add script to run staticcheck for go-ethereum tools: add staticcheck wrapper script

tools: add staticcheck wrapper script. This script checks if staticcheck is installed and runs it on the go-ethereum codebase.
This commit is contained in:
patridunk 2025-12-16 12:44:50 +01:00 committed by GitHub
parent 6978ab48aa
commit 043f039d7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
# Wrapper script to run staticcheck against the go-ethereum codebase,
# if staticcheck is installed.
if ! command -v staticcheck >/dev/null 2>&1; then
echo "staticcheck is not installed. You can install it via:"
echo " go install honnef.co/go/tools/cmd/staticcheck@latest"
exit 0
fi
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${ROOT_DIR}"
echo "Running staticcheck on ./..."
staticcheck ./...
echo
echo "staticcheck finished."