test: validate raw stream token replay and enforce gofmt in lint script

This commit is contained in:
CJACK.
2026-04-06 11:15:08 +08:00
parent a8c160b05d
commit 9e0fd83a76
3 changed files with 210 additions and 1 deletions

16
scripts/lint.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT_DIR"
LINT_BIN="${GOLANGCI_LINT_BIN:-golangci-lint}"
# v2 separates formatters from linters; enforce both in one entrypoint.
if [[ "$LINT_BIN" == *" "* ]]; then
eval "$LINT_BIN fmt --diff -c .golangci.yml"
eval "$LINT_BIN run -c .golangci.yml"
else
"$LINT_BIN" fmt --diff -c .golangci.yml
"$LINT_BIN" run -c .golangci.yml
fi