diff --git a/.gitignore b/.gitignore index 459413d..158edbd 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ bin/ # 构建产物(worker 曾把 7.9M 二进制留在工作区,2026-09-21) go/zhiyi-cli go/zhiyid + +# 临时工件(cron list dump,随时可 `hermes cron list` 重现,不入库) +cron_raw.txt diff --git a/Makefile b/Makefile index bf5449d..8430fab 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ # ─── 变量 ──────────────────────────────────────────── GO_CMD := go RUST_CMD := cargo +GOFMT_CMD := gofmt GO_DIR := go RUST_DIR := rust BINARY_GO := $(GO_DIR)/cmd/zhiyid/zhiyid @@ -81,6 +82,15 @@ deploy-compose: docker-build test: cd $(GO_DIR) && $(GO_CMD) test ./... -v -count=1 +# 格式校验:gofmt 不合规即报错(gofmt -l 列出文件 → 非空则 exit 1) +fmt-check: + @cd $(GO_DIR) && $(GOFMT_CMD) -l . | tee /tmp/.gofmt_files > /dev/null; \ + if [ -s /tmp/.gofmt_files ]; then \ + echo "❌ gofmt 不合规文件($(GOFMT_CMD) -l . 非空):"; \ + $(GOFMT_CMD) -l . ; \ + echo " 修复: cd $(GO_DIR) && $(GOFMT_CMD) -w ."; exit 1; \ + else echo "✅ gofmt 合规(0 文件)"; fi + test-go: test test-rust: