arch: add trivial-accessor exemption comments in workspace.go - #681
Merged
Conversation
Add `// no test by design — trivial accessor` to every trivial one-liner method in pkg/mdsmith/workspace.go: memFile.Close, memDir.Read and Close, memDirEntry.Name/IsDir/Type/Info, and memFileInfo.Name/Size/Mode/ModTime/IsDir/Sys. Mark plan 2606211910 complete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UGkejhkQXgkXqgii9tVKw
…ct trivial-accessor exemption Both memDirEntry.Type() and memFileInfo.Mode() have if/else branches; the architecture rule (tests.md §Exemptions) restricts the "no test by design" exemption to "trivial accessor with no branch". Remove the incorrect comments and add TestMemDirEntry_Type / TestMemFileInfo_Mode covering both branches of each method.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
Author
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
Owner
Author
|
🔵 Merge Queue — CI running Merged into batch branch Next: No action needed — you'll be notified when CI completes. |
4 tasks
Owner
Author
|
✅ Merge Queue — merged This PR landed on Next: Done — nothing more to do here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
// no test by design — trivial accessorto every truly trivial one-liner method inpkg/mdsmith/workspace.goso the architecture audit can distinguish intentional exemptions from forgotten tests (plan 2606211910)memDirEntry.Type()andmemFileInfo.Mode()were initially mis-labelled (both haveif/elsebranches and do not qualify for the no-branch exemption perdocs/development/architecture/tests.md §Exemptions) — their incorrect exemption comments were removed and dedicated unit tests added instead2606211910completeTest plan
go build ./...passesgo test ./pkg/mdsmith/...passes (includes newTestMemDirEntry_TypeandTestMemFileInfo_Mode)/code-review xhigh --fixrounds applied; rounds 2 and 3 returned[]🤖 Generated with Claude Code
Generated by Claude Code