From 043f039d7f00d9118f730089a26892411b8801c1 Mon Sep 17 00:00:00 2001 From: patridunk <78499649+patridunk@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:44:50 +0100 Subject: [PATCH] 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. --- devtools/run_staticcheck.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 devtools/run_staticcheck.sh 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."