diff --git a/devtools/run_staticcheck.sh b/devtools/run_staticcheck.sh new file mode 100644 index 0000000000..23630c6516 --- /dev/null +++ b/devtools/run_staticcheck.sh @@ -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."