This is an automated email from the ASF dual-hosted git repository.
lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git
The following commit(s) were added to refs/heads/rocketmq-studio by this push:
new 5c27b9a67 fix(rmqctl): stop the lint target from swallowing
golangci-lint failures (#5210)
5c27b9a67 is described below
commit 5c27b9a6733230510f401313c0197ccf6fa40891
Author: 健康宝 <[email protected]>
AuthorDate: Fri Oct 9 11:24:37 2026 +0800
fix(rmqctl): stop the lint target from swallowing golangci-lint failures
(#5210)
`command -v golangci-lint && golangci-lint run ./... || echo "not
installed; skipping"` reports a
real lint failure as "not installed" and exits 0, because `||` binds to the
whole `&&` chain.
Rewrite as if/then/else so the linter's exit code propagates. Only
occurrence of this pattern in
the repository.
---
rmqctl/Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/rmqctl/Makefile b/rmqctl/Makefile
index 0f8e1e601..3ad067026 100644
--- a/rmqctl/Makefile
+++ b/rmqctl/Makefile
@@ -57,7 +57,11 @@ fmt:
@out=`gofmt -l . 2>&1`; if [ -n "$$out" ]; then echo "$$out"; exit 1; fi
lint: vet
- @command -v golangci-lint >/dev/null 2>&1 && golangci-lint run ./... ||
echo "golangci-lint not installed; skipping"
+ @if command -v golangci-lint >/dev/null 2>&1; then \
+ golangci-lint run ./...; \
+ else \
+ echo "golangci-lint not installed; skipping"; \
+ fi
verify: fmt test-race vet build