You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "chennaji9 (via GitHub)" <gi...@apache.org> on 2026/09/30 08:11:08 UTC

[PR] fix(rmqctl): stop the lint target from swallowing golangci-lint failures [rocketmq-dashboard]

chennaji9 opened a new pull request, #5210:
URL: https://github.com/apache/rocketmq-dashboard/pull/5210

   ### Which Issue(s) This PR Fixes
   
   None — small self-contained fix found by inspection (no issue tracked).
   
   ### Brief Description
   
   The `lint` recipe ran `command -v golangci-lint >/dev/null 2>&1 && golangci-lint run ./... || echo "golangci-lint not installed; skipping"`. Because `||` also catches the linter's own failure, a repo that fails lint printed the "not installed; skipping" notice and still exited 0 — the failure was swallowed and the message was wrong. The recipe now uses an explicit `if command -v …; then …; else …; fi` so the linter's exit code propagates and the skipping notice only appears when the tool really is absent.
   
   Base is `rocketmq-studio` per CONTRIBUTING.md (the PR template's base comment is outdated).
   
   ### How Did You Test This Change?
   
   `cd rmqctl`:
   
   - Without golangci-lint on PATH: `make lint` runs `vet` (catalog-verify + `go vet ./...`, both pass) and prints `golangci-lint not installed; skipping`, exit 0 — unchanged behaviour.
   - With a fake `golangci-lint` on PATH that exits 7: `make lint` exits non-zero (make reports error 2) and does **not** print the "not installed" notice — failure now propagates.
   - `go vet ./...` across the module: clean; `go test -race -count=1 ./cmd/` passes (guard against incidental breakage).
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`fix:`)
   - [ ] Tests added or updated for non-trivial changes (Makefile behaviour verified manually with a fake failing linter as above; no Make test harness exists in this repo)
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` (n/a — no UI change)
   - [x] Architecture constraints stay green (n/a — no Java change)
   - [x] New source files carry the ASF license header (n/a — no new source file)
   - [x] Documentation touched where behaviour changed (n/a — target semantics now match its own message)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(rmqctl): stop the lint target from swallowing golangci-lint failures [rocketmq-dashboard]

Posted by "chennaji9 (via GitHub)" <gi...@apache.org>.
chennaji9 commented on PR #5210:
URL: https://github.com/apache/rocketmq-dashboard/pull/5210#issuecomment-5988153255

   Re-ran the lint target locally: without this change a failing `golangci-lint run` is still masked by the subsequent `exit 0`, so CI stays green on real lint findings. The fix propagates the tool's exit status while keeping the "tool not installed" path friendly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(rmqctl): stop the lint target from swallowing golangci-lint failures [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #5210:
URL: https://github.com/apache/rocketmq-dashboard/pull/5210


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org