mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-08-06 00:44:22 +02:00
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 <me@silverwind.io>
This commit is contained in:
2
Makefile
2
Makefile
@@ -97,7 +97,7 @@ go-check:
|
|||||||
|
|
||||||
.PHONY: fmt-check
|
.PHONY: fmt-check
|
||||||
fmt-check: fmt
|
fmt-check: fmt
|
||||||
@diff=$$(git diff --color=always); \
|
@diff=$$(git diff --color=always -- '*.go'); \
|
||||||
if [ -n "$$diff" ]; then \
|
if [ -n "$$diff" ]; then \
|
||||||
echo "Please run 'make fmt' and commit the result:"; \
|
echo "Please run 'make fmt' and commit the result:"; \
|
||||||
printf "%s" "$${diff}"; \
|
printf "%s" "$${diff}"; \
|
||||||
|
|||||||
Reference in New Issue
Block a user