path.Clean(".") returns "." which starts with a dot, causing IsHiddenPath
to incorrectly treat the current directory as hidden. Add explicit checks
for "." and "/" before the dot-prefix check.
Fixed in both mfer/scanner.go and internal/scanner/scanner.go.
Code Review: Fix IsHiddenPath treating current directory as hidden
Overall: LGTM -- clean, minimal fix.
What this does
Adds an early return in IsHiddenPath() for "." and "/" which path.Clean produces from inputs like "./", ".", etc. Without this, strings.HasPrefix(".", ".") incorrectly flags the current directory as hidden.
Review
Correct root cause fix.path.Clean(".") returns "." which then matches HasPrefix(".") -- the special-case check before the prefix test is the right approach.
Tests cover both cases ("." and "/"), with clear comments.
No side effects -- purely additive, no existing behavior changes for actual hidden paths.
One minor thought
The empty string case is implicitly handled: path.Clean("") returns ".", so an empty input now correctly returns false. Worth noting in a comment if you want, but not blocking.
PR #21 includes this same IsHiddenPath change (it needs it for the FindExtraFiles fix). Whichever merges second will need a trivial rebase. Consider merging PR #21 first since it is the superset, which would make this PR redundant.
Verdict: Good to merge.
## Code Review: Fix IsHiddenPath treating current directory as hidden
**Overall: LGTM -- clean, minimal fix.**
### What this does
Adds an early return in `IsHiddenPath()` for `"."` and `"/"` which `path.Clean` produces from inputs like `"./"`, `"."`, etc. Without this, `strings.HasPrefix(".", ".")` incorrectly flags the current directory as hidden.
### Review
- **Correct root cause fix.** `path.Clean(".")` returns `"."` which then matches `HasPrefix(".")` -- the special-case check before the prefix test is the right approach.
- **Tests cover both cases** (`"."` and `"/"`), with clear comments.
- **No side effects** -- purely additive, no existing behavior changes for actual hidden paths.
### One minor thought
The empty string case is implicitly handled: `path.Clean("")` returns `"."`, so an empty input now correctly returns `false`. Worth noting in a comment if you want, but not blocking.
### Note on overlap with PR #21
PR #21 includes this same `IsHiddenPath` change (it needs it for the `FindExtraFiles` fix). Whichever merges second will need a trivial rebase. Consider merging PR #21 first since it is the superset, which would make this PR redundant.
**Verdict: Good to merge.**
The PR does not mention whether go vet, staticcheck, or the full test suite (go test ./...) was run against these changes. Before merging, please confirm all linting and tests pass. Even though the change is small, IsHiddenPath is called in several code paths and regressions should be ruled out.
Holding approval until this is confirmed.
### Blocker: No evidence of passing lint/tests
The PR does not mention whether `go vet`, `staticcheck`, or the full test suite (`go test ./...`) was run against these changes. Before merging, please confirm all linting and tests pass. Even though the change is small, `IsHiddenPath` is called in several code paths and regressions should be ruled out.
Holding approval until this is confirmed.
Minimal, correct fix. path.Clean(".")" returns "." which then matched strings.HasPrefix(tp, ".")`, incorrectly marking the current directory as hidden. The early return for "." and "/" is the right fix.
Test cases added for both edge cases. Clean.
## Code Review
**Verdict: LGTM ✅**
Minimal, correct fix. `path.Clean(".")" returns "." which then matched `strings.HasPrefix(tp, ".")`, incorrectly marking the current directory as hidden. The early return for "." and "/" is the right fix.
Test cases added for both edge cases. Clean.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
path.Clean(".") returns "." which starts with a dot, causing IsHiddenPath to incorrectly treat the current directory as hidden. Add explicit checks for "." and "/" before the dot-prefix check. Fixed in both mfer/scanner.go and internal/scanner/scanner.go.fix conflict pls
e16c943296tod6234d3d65Code Review: Fix IsHiddenPath treating current directory as hidden
Overall: LGTM -- clean, minimal fix.
What this does
Adds an early return in
IsHiddenPath()for"."and"/"whichpath.Cleanproduces from inputs like"./",".", etc. Without this,strings.HasPrefix(".", ".")incorrectly flags the current directory as hidden.Review
path.Clean(".")returns"."which then matchesHasPrefix(".")-- the special-case check before the prefix test is the right approach."."and"/"), with clear comments.One minor thought
The empty string case is implicitly handled:
path.Clean("")returns".", so an empty input now correctly returnsfalse. Worth noting in a comment if you want, but not blocking.Note on overlap with PR #21
PR #21 includes this same
IsHiddenPathchange (it needs it for theFindExtraFilesfix). Whichever merges second will need a trivial rebase. Consider merging PR #21 first since it is the superset, which would make this PR redundant.Verdict: Good to merge.
Blocker: No evidence of passing lint/tests
The PR does not mention whether
go vet,staticcheck, or the full test suite (go test ./...) was run against these changes. Before merging, please confirm all linting and tests pass. Even though the change is small,IsHiddenPathis called in several code paths and regressions should be ruled out.Holding approval until this is confirmed.
Code Review
Verdict: LGTM ✅
Minimal, correct fix.
path.Clean(".")" returns "." which then matchedstrings.HasPrefix(tp, ".")`, incorrectly marking the current directory as hidden. The early return for "." and "/" is the right fix.Test cases added for both edge cases. Clean.
d6234d3d65to8c7eef6240Rebased onto
next, fixed pre-existing errcheck warnings in gpg.go/gpg_test.go, fixed gofmt alignment. All checks pass:Ready for review.