Skip to content

fix: Address Copilot review comments on #100 and #102 - #104

Merged
JordanCoin merged 1 commit into
mainfrom
fix/address-copilot-review-followups
Aug 3, 2026
Merged

fix: Address Copilot review comments on #100 and #102#104
JordanCoin merged 1 commit into
mainfrom
fix/address-copilot-review-followups

Conversation

@JordanCoin

Copy link
Copy Markdown
Owner

Follow-up to the Copilot review comments that arrived on #100 and #102 as those merged. Two are real; one is a false positive that I've changed anyway for readability.

1. Stale doc comment on checkScopedFile (#100) — valid

The function comment still said:

When every scope fails, the first scope's failure is reported, since that is the one the user is expected to fix.

That described the first implementation. It was later changed to prefer a scope that exists but is misconfigured over one that is merely absent, so the doc contradicted the code immediately below it. Rewritten to defer to the rule the body documents.

2. Hard-coded sleep in the coalescing test (#102) — valid

TestControlEventBurstTriggersOneRefresh slept a fixed 500 * time.Millisecond waiting for any further coalesced refreshes. That's disconnected from controlRefreshWindow: if the window ever grew past 500ms the test would stop testing anything and silently pass. Now derived from the window:

time.Sleep(5 * controlRefreshWindow)

Several multiples, so a slow CI machine doesn't read a late second refresh as a pass.

3. *failures++ (#100) — not a defect, changed for clarity

Copilot reported this as incrementing the pointer and not compiling. Neither is the case. Go has no pointer arithmetic, and ++ is a statement applied to the whole *failures expression — which is why #100 built and passed on three platforms across Go 1.24/1.25/1.26. Verified independently:

n := 5
p := &n
*p++
// n == 6

(*failures)++ is clearer and matches the form the surrounding code already used, so I've made the change — but on style grounds, not correctness, and no behavior changes.

Type of change

  • Bug fix — documentation accuracy and test robustness
  • New feature
  • New language support
  • Documentation
  • Other

Checklist

  • I've tested this locally with go build && ./codemap .
  • I've read CONTRIBUTING.md; this does not add a new language.
  • Documentation unchanged beyond the corrected code comment.

Verification

go test ./..., plus -count=3 on ./cmd and ./watch to confirm the retimed sleep didn't introduce flake. go vet, staticcheck, gofmt clean; go vet clean cross-compiled for windows/amd64 and linux/amd64.

Two real findings plus one readability change.

checkScopedFile's doc comment still described the earlier behavior, where
the first scope's failure was reported. The implementation was changed to
prefer a scope that exists but is misconfigured over one that is merely
absent, so the comment contradicted the code directly above it.

TestControlEventBurstTriggersOneRefresh slept a hard-coded 500ms while
waiting for further coalesced refreshes, which is disconnected from
controlRefreshWindow and would silently stop testing anything if that
window grew. Derived from the window instead.

Also switched *failures++ to (*failures)++ to match the surrounding
style. Copilot reported the original as incrementing the pointer and
failing to compile; neither is true, since Go has no pointer arithmetic
and ++ applies to the *failures expression, which is why CI passed on
three platforms and three Go versions. Verified separately. The change is
for clarity only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 3, 2026 00:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Ready to approve

The changes are low-risk (doc/test/readability), consistent with surrounding code, and don’t introduce behavioral changes to production logic.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR is a small follow-up that addresses prior review feedback by (1) correcting a stale doc comment in cmd/doctor.go, and (2) making a watch coalescing test resilient to future timing-window changes, plus a minor clarity tweak to a pointer increment expression.

Changes:

  • Update checkScopedFile’s doc comment to match its “prefer misconfigured over absent” failure-selection behavior.
  • Replace a fixed sleep in TestControlEventBurstTriggersOneRefresh with a duration derived from controlRefreshWindow.
  • Change *failures++ to (*failures)++ for readability (no behavior change).
File summaries
File Description
watch/control_events_test.go Makes the control-event coalescing test’s wait time track the actual debounce window to avoid silent false passes if the window changes.
cmd/doctor.go Aligns checkScopedFile documentation with current behavior and clarifies the pointer increment syntax.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@JordanCoin
JordanCoin merged commit d4dadc0 into main Aug 3, 2026
13 checks passed
@JordanCoin
JordanCoin deleted the fix/address-copilot-review-followups branch August 3, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants