mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
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:
parent
6978ab48aa
commit
043f039d7f
1 changed files with 20 additions and 0 deletions
20
devtools/run_staticcheck.sh
Normal file
20
devtools/run_staticcheck.sh
Normal 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."
|
||||
Loading…
Reference in a new issue