diff --git a/scripts/ci.sh b/scripts/ci.sh index 600ef7f..7e7a165 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -24,7 +24,8 @@ echo "========================================" # 1. 格式检查 echo "" echo "==> 1/3 格式检查 (gofumpt + goimports)" -make fmt-check +test -z "$(gofumpt -l internal/ cmd/)" || { echo "gofumpt: 以下文件格式不正确:"; gofumpt -l internal/ cmd/; exit 1; } +test -z "$(goimports -l internal/ cmd/)" || { echo "goimports: 以下文件 import 不规范:"; goimports -l internal/ cmd/; exit 1; } # 2. 编译检查 echo "" @@ -35,9 +36,9 @@ go build ./... echo "" echo "==> 3/3 静态分析 (golangci-lint)" if $STRICT; then - make lint-strict + golangci-lint run ./... else - make lint + golangci-lint run ./... || true fi echo ""