Fix FindExtraFiles reporting manifest and dotfiles as extra (closes #16) #21
No reviewers
Labels
No Label
merge-ready
merge-ready
needs-checks
needs-checks
needs-rebase
needs-rebase
needs-review
needs-review
needs-rework
needs-rework
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/mfer#21
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/issue-16"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix the merge conflict please
ce2540d7e1tobc4366aad4Code Review: Fix FindExtraFiles reporting manifest and dotfiles as extra
Overall: LGTM with minor suggestions.
Changes summary
IsHiddenPath()on the relative path, usingfilepath.SkipDirfor directoriesindex.mfand.index.mf) by basename checkpathtowalkPathto avoid shadowing thepathstdlib importIsHiddenPathfix from PR #19 (the.//guard) -- necessary sinceFindExtraFilescallsIsHiddenPathwith relative pathsReview
filepath.Relfirst, then checking hidden, then skipping dirs, then checking manifest names -- the flow makes sense and avoids unnecessary work.filepath.SkipDirfor hidden directories is important for performance -- avoids descending into.git/,.DS_Storedirectories, etc.filepath.ToSlash(rel)before passing toIsHiddenPathensures cross-platform correctness sinceIsHiddenPathusespath.Clean(forward-slash semantics).TestFindExtraFilesSkipsManifestAndDotfilescovers dotfiles, nested dotfile dirs (.config/settings), manifest file, and a real extra file.pathtowalkPathremoves the stdlib shadow -- nice cleanup.Suggestions
Hardcoded manifest names:
"index.mf"and".index.mf"are hardcoded in the skip check. If these names are defined as constants elsewhere in the codebase, referencing those constants would be more maintainable. Low priority if the names are stable.PR #19 overlap: This PR includes the same
IsHiddenPathfix as PR #19 (same diff inscanner.go). Since this is the superset, consider merging this first -- PR #19 would then become a no-op or can be closed.Verdict: Good to merge. Solid fix with proper test coverage.
Blocker: No evidence of passing lint/tests
This PR touches core logic in
FindExtraFiles(reordering operations, adding new skip conditions, renaming variables) but does not mention whether the full test suite and linters were run. Please confirmgo test ./...,go vet ./..., and any project-specific linting (e.g.staticcheck) all pass before merging.Additionally: the new test
TestFindExtraFilesSkipsManifestAndDotfilesuses a.index.mfmanifest path but the test helpercreateTestManifestmay or may not handle that correctly -- worth verifying the test actually runs and passes, not just compiles.Holding approval until this is confirmed.
Code Review
Verdict: LGTM ✅
Fixes two false positive sources in
FindExtraFiles:filepath.SkipDir)index.mf,.index.mf) were reported as extra (now explicitly skipped)The implementation correctly:
filepath.SkipDirfor hidden directories (efficient — skips whole subtree)pathvariable towalkPathto avoid confusion with thepathpackageTest coverage is good — verifies dotfiles, dot-directories, and manifest files are all excluded while real extra files are still caught.
Also includes the
IsHiddenPathfix from #19 — coordinate merge order to avoid conflicts.bc4366aad4to7b61bdd62bRebased onto
next, fixed pre-existing errcheck warnings in gpg.go/gpg_test.go. All checks pass:Ready for review.