fix(repo):统一发布健康与只读质量门禁
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-13 22:09:44 +08:00
parent 32fc64fa83
commit c17904ee1c
25 changed files with 869 additions and 184 deletions
+9 -5
View File
@@ -1,4 +1,4 @@
.PHONY: help build build-ffi test clean check check-docs fmt lint install dev docker-build docker-up docker-down official-smoke bat-api-local-live-smoke build-go build-go-api build-go-cli test-go test-go-api test-go-ffi test-go-all
.PHONY: help build build-ffi test clean check check-docs format fmt lint ci ci-check install dev docker-build docker-up docker-down official-smoke bat-api-local-live-smoke build-go build-go-api build-go-cli test-go test-go-api test-go-ffi test-go-all
# 默认目标
.DEFAULT_GOAL := help
@@ -102,6 +102,8 @@ check-docs: ## 检查权威状态文档与占位目录声明
fmt: fmt-rust fmt-go ## 格式化所有代码
format: fmt ## 格式化所有代码(会修改工作树)
fmt-rust: ## 格式化 Rust 代码
@echo "$(BLUE)Formatting Rust code...$(NC)"
cargo fmt --all
@@ -118,9 +120,9 @@ lint-rust: ## Rust Clippy 检查
lint-go: ## Go Linter 检查
@echo "$(BLUE)Running golangci-lint...$(NC)"
@command -v golangci-lint >/dev/null 2>&1 || { echo "$(YELLOW)golangci-lint not installed, skipping...$(NC)"; exit 0; }
@command -v golangci-lint >/dev/null 2>&1 || { echo "$(YELLOW)OPTIONAL gate skipped: golangci-lint is not installed$(NC)"; exit 0; }
@if [ -n "$$(go list ./... 2>/dev/null)" ]; then \
golangci-lint run ./...; \
XDG_CACHE_HOME="$${XDG_CACHE_HOME:-/tmp/bat-xdg-cache}" golangci-lint run ./...; \
else \
echo "$(YELLOW)No Go packages yet, skipping...$(NC)"; \
fi
@@ -189,5 +191,7 @@ docs: ## 生成文档
# CI/CD
# ============================================================================
ci: fmt lint test ## 运行 CI 检查(本地模拟
@echo "$(GREEN)✓ All CI checks passed!$(NC)"
ci-check: ## 运行只读 required CI 门禁(可选 lint 会明确标记
@bash scripts/ci-check.sh
ci: ci-check ## 运行只读 CI 检查(兼容旧命令名)