Fix FindExtraFiles reporting manifest and dotfiles as extra (closes #16) #21

Merged
sneak merged 2 commits from fix/issue-16 into next 2026-02-20 11:38:52 +01:00
Collaborator
No description provided.
sneak was assigned by clawbot 2026-02-08 21:06:25 +01:00
clawbot added 1 commit 2026-02-08 21:06:25 +01:00
FindExtraFiles now skips hidden files/directories and manifest files
(index.mf, .index.mf) when looking for extra files. Previously it would
report these as 'extra' even though they are intentionally excluded from
manifests by default, making --no-extra-files unusable.

Also includes IsHiddenPath fix for '.' (needed by the new filtering).
Owner

fix the merge conflict please

fix the merge conflict please
clawbot force-pushed fix/issue-16 from ce2540d7e1 to bc4366aad4 2026-02-09 02:12:36 +01:00 Compare
clawbot reviewed 2026-02-16 05:56:52 +01:00
clawbot left a comment
Author
Collaborator

Code Review: Fix FindExtraFiles reporting manifest and dotfiles as extra

Overall: LGTM with minor suggestions.

Changes summary

  1. Skips hidden files/dirs via IsHiddenPath() on the relative path, using filepath.SkipDir for directories
  2. Skips manifest files (index.mf and .index.mf) by basename check
  3. Renames shadow variable path to walkPath to avoid shadowing the path stdlib import
  4. Includes the IsHiddenPath fix from PR #19 (the .// guard) -- necessary since FindExtraFiles calls IsHiddenPath with relative paths

Review

  • Logic ordering is correct. Computing filepath.Rel first, then checking hidden, then skipping dirs, then checking manifest names -- the flow makes sense and avoids unnecessary work.
  • filepath.SkipDir for hidden directories is important for performance -- avoids descending into .git/, .DS_Store directories, etc.
  • filepath.ToSlash(rel) before passing to IsHiddenPath ensures cross-platform correctness since IsHiddenPath uses path.Clean (forward-slash semantics).
  • Good test coverage. TestFindExtraFilesSkipsManifestAndDotfiles covers dotfiles, nested dotfile dirs (.config/settings), manifest file, and a real extra file.
  • Variable rename path to walkPath removes the stdlib shadow -- nice cleanup.

Suggestions

  1. 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.

  2. PR #19 overlap: This PR includes the same IsHiddenPath fix as PR #19 (same diff in scanner.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.

## Code Review: Fix FindExtraFiles reporting manifest and dotfiles as extra **Overall: LGTM with minor suggestions.** ### Changes summary 1. **Skips hidden files/dirs** via `IsHiddenPath()` on the relative path, using `filepath.SkipDir` for directories 2. **Skips manifest files** (`index.mf` and `.index.mf`) by basename check 3. **Renames shadow variable** `path` to `walkPath` to avoid shadowing the `path` stdlib import 4. **Includes the `IsHiddenPath` fix** from PR #19 (the `.`/`/` guard) -- necessary since `FindExtraFiles` calls `IsHiddenPath` with relative paths ### Review - **Logic ordering is correct.** Computing `filepath.Rel` first, then checking hidden, then skipping dirs, then checking manifest names -- the flow makes sense and avoids unnecessary work. - **`filepath.SkipDir` for hidden directories** is important for performance -- avoids descending into `.git/`, `.DS_Store` directories, etc. - **`filepath.ToSlash(rel)`** before passing to `IsHiddenPath` ensures cross-platform correctness since `IsHiddenPath` uses `path.Clean` (forward-slash semantics). - **Good test coverage.** `TestFindExtraFilesSkipsManifestAndDotfiles` covers dotfiles, nested dotfile dirs (`.config/settings`), manifest file, and a real extra file. - **Variable rename** `path` to `walkPath` removes the stdlib shadow -- nice cleanup. ### Suggestions 1. **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. 2. **PR #19 overlap**: This PR includes the same `IsHiddenPath` fix as PR #19 (same diff in `scanner.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.
clawbot reviewed 2026-02-16 05:58:12 +01:00
clawbot left a comment
Author
Collaborator

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 confirm go test ./..., go vet ./..., and any project-specific linting (e.g. staticcheck) all pass before merging.

Additionally: the new test TestFindExtraFilesSkipsManifestAndDotfiles uses a .index.mf manifest path but the test helper createTestManifest may or may not handle that correctly -- worth verifying the test actually runs and passes, not just compiles.

Holding approval until this is confirmed.

### 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 confirm `go test ./...`, `go vet ./...`, and any project-specific linting (e.g. `staticcheck`) all pass before merging. Additionally: the new test `TestFindExtraFilesSkipsManifestAndDotfiles` uses a `.index.mf` manifest path but the test helper `createTestManifest` may or may not handle that correctly -- worth verifying the test actually runs and passes, not just compiles. Holding approval until this is confirmed.
Author
Collaborator

Code Review

Verdict: LGTM

Fixes two false positive sources in FindExtraFiles:

  1. Dotfiles/hidden directories were walked and reported as extra (now skipped with filepath.SkipDir)
  2. Manifest files (index.mf, .index.mf) were reported as extra (now explicitly skipped)

The implementation correctly:

  • Computes relative path before the directory check so hidden dirs can be skipped entirely
  • Uses filepath.SkipDir for hidden directories (efficient — skips whole subtree)
  • Renames shadowed path variable to walkPath to avoid confusion with the path package

Test coverage is good — verifies dotfiles, dot-directories, and manifest files are all excluded while real extra files are still caught.

Also includes the IsHiddenPath fix from #19 — coordinate merge order to avoid conflicts.

## Code Review **Verdict: LGTM ✅** Fixes two false positive sources in `FindExtraFiles`: 1. Dotfiles/hidden directories were walked and reported as extra (now skipped with `filepath.SkipDir`) 2. Manifest files (`index.mf`, `.index.mf`) were reported as extra (now explicitly skipped) The implementation correctly: - Computes relative path *before* the directory check so hidden dirs can be skipped entirely - Uses `filepath.SkipDir` for hidden directories (efficient — skips whole subtree) - Renames shadowed `path` variable to `walkPath` to avoid confusion with the `path` package Test coverage is good — verifies dotfiles, dot-directories, and manifest files are all excluded while real extra files are still caught. Also includes the `IsHiddenPath` fix from #19 — coordinate merge order to avoid conflicts.
clawbot force-pushed fix/issue-16 from bc4366aad4 to 7b61bdd62b 2026-02-20 08:43:05 +01:00 Compare
Author
Collaborator

Rebased onto next, fixed pre-existing errcheck warnings in gpg.go/gpg_test.go. All checks pass:

make test: PASS (all packages)
make lint: 0 issues, gofmt clean

Ready for review.

Rebased onto `next`, fixed pre-existing errcheck warnings in gpg.go/gpg_test.go. All checks pass: ``` make test: PASS (all packages) make lint: 0 issues, gofmt clean ``` Ready for review.
clawbot added the
merge-ready
label 2026-02-20 09:17:21 +01:00
sneak merged commit ae70cf6fb5 into next 2026-02-20 11:38:52 +01:00
Sign in to join this conversation.
No description provided.