From e4fe49dba402721440531e353c918b65c80209ac Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 30 Jul 2026 13:06:28 +0000 Subject: [PATCH] chore: scope `fmt-check` to Go sources (#1125) `fmt-check` runs `make fmt` and then diffs the whole working tree, so any unrelated uncommitted file makes it fail with `Please run 'make fmt' and commit the result` even when the formatter changed nothing. Restrict the diff to the files the formatter can touch, matching what [gitea's Makefile](https://github.com/go-gitea/gitea/blob/main/Makefile) does. Reviewed-on: https://gitea.com/gitea/runner/pulls/1125 Reviewed-by: techknowlogick <9+techknowlogick@noreply.gitea.com> Co-authored-by: silverwind --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d41c6b9e..89bf6c92 100644 --- a/Makefile +++ b/Makefile @@ -97,7 +97,7 @@ go-check: .PHONY: fmt-check fmt-check: fmt - @diff=$$(git diff --color=always); \ + @diff=$$(git diff --color=always -- '*.go'); \ if [ -n "$$diff" ]; then \ echo "Please run 'make fmt' and commit the result:"; \ printf "%s" "$${diff}"; \