fix quickstyle: run golangci-lint in the repo you invoked it from - #117
fix quickstyle: run golangci-lint in the repo you invoked it from#117vikin91 wants to merge 1 commit into
Conversation
quickstyle passed absolute package dirs. With two clones next to each other, golangci-lint reported ../sibling/central/... so wrapcheck exclusions like ^central/ did not match. cd to gitroot and strip that prefix so the invocation matches make golangci-lint in this clone. User request: fix the wrapcheck false positives in quickstyle (workflow repo), not in stackrox .golangci.yml. Partially generated by AI. rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review. 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe quickstyle script now runs ChangesLint execution
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized change makes quickstyle run golangci-lint against the checked-out repository paths, with no actionable merge-blocking risk remaining after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Description
If you keep two StackRox checkouts next to each other (
stackroxandstackrox2) and runquickstylein the second one, golangci-lint can report files as if they lived in the first checkout:StackRox turns the wrapcheck linter off for paths that start with
central/. A path that starts with../stackrox/does not, soquickstyleprints a wall of wrapcheck errors thatmake golangci-lintin the same repo does not.The reason is the argument we passed.
quickstyleused to call golangci-lint with a full filesystem path:StackRox
make golangci-lintdoes this instead:This change
cds into the checkout where you ranquickstyleand strips that checkout's directory off the package list, so the invocation matchesmake golangci-lintin that clone. Findings then look likecentral/cluster/datastore/foo.go, and the existing skip rules apply.AI-Assisted: cursor, generated the golangci-lint invocation change; user reviewed.
How I validated my change
Ran
quickstylefrom a second StackRox clone after editing a file undercentral/. golangci-lint reported 0 issues instead of wrapcheck errors ondatastore_impl.go.