HYPERFLEET-1315 - chore: scope golangci-lint hook findings to changed lines only#68
Conversation
📝 WalkthroughWalkthrough
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
hyperfleet-hooks/README.md (1)
17-17: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDoc doesn't flag the untracked-file gap.
Docs state the hook runs after a file is "edited or created" and only reports "lines changed since the last commit." As raised in
lint-go.sh, that guarantee doesn't actually hold for newly-created (untracked) files under--new-from-rev=HEAD— they'll get zero lint feedback instead of falling back cleanly. Once the root-cause fix inlint-go.shlands, update this line to reflect actual behavior for new files.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hyperfleet-hooks/README.md` at line 17, Update the README wording for the golangci-lint hook to match the real behavior for newly created untracked Go files; the current “edited or created” and “lines changed since the last commit” description is too strong for the `lint-go.sh` flow. Adjust the hook description in `README.md` so it accurately reflects the `lint-go.sh` behavior after the root-cause fix, especially around fallback and coverage for new files, using the hook’s linting step as the reference point.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@hyperfleet-hooks/hooks/lint-go.sh`:
- Around line 31-44: The lint-go.sh logic around USE_NEW_FROM_REV and LINT_ARGS
should account for untracked .go files, since --new-from-rev=HEAD can miss
brand-new files that are not yet in git diff. Update the flow near the
rev-parse/--new-from-rev setup to detect untracked paths under LINT_DIR and
either stage them with git add -N before running golangci-lint or disable the
diff-scoped flag for that run. Keep the fix localized to the lint argument
assembly so existing behavior for tracked files remains unchanged.
---
Duplicate comments:
In `@hyperfleet-hooks/README.md`:
- Line 17: Update the README wording for the golangci-lint hook to match the
real behavior for newly created untracked Go files; the current “edited or
created” and “lines changed since the last commit” description is too strong for
the `lint-go.sh` flow. Adjust the hook description in `README.md` so it
accurately reflects the `lint-go.sh` behavior after the root-cause fix,
especially around fallback and coverage for new files, using the hook’s linting
step as the reference point.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 37475303-aaf9-4a6a-8eb8-c5e8164d0240
📒 Files selected for processing (4)
AGENTS.mdhyperfleet-hooks/.claude-plugin/plugin.jsonhyperfleet-hooks/README.mdhyperfleet-hooks/hooks/lint-go.sh
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift-hyperfleet/architecture(manual)openshift-hyperfleet/hyperfleet-api(manual)openshift-hyperfleet/hyperfleet-sentinel(manual)openshift-hyperfleet/hyperfleet-adapter(manual)openshift-hyperfleet/hyperfleet-broker(manual)
01a488c to
f246a85
Compare
findings to changed lines only
f246a85 to
67d3f01
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rafabene The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5d436b5
into
openshift-hyperfleet:main
HYPERFLEET-1315
Scope the golangci-lint Claude Code hook to only report findings on changed lines, so pre-existing lint issues don't block Claude.
Changes
Testing
.gofile with a lint issue