A directory that --exclude or --exclude-dotfiles excludes still fails the run when it cannot be listed (for example permission denied). filepath.Walk hands the callback the listing error for that directory, and both walk callbacks in attrsum.go (walkAndProcess and countFiles) return any error before they check exclusions. So excluding a directory does not keep its errors out of the result. Found while working on #11.
Implementation
In both callbacks, check whether the path is excluded before looking at the error, so an excluded path is skipped whatever went wrong reading it. Everything else stays as it is.
A test: an unreadable directory that an --exclude pattern matches, next to a readable file; sum add and check succeed and touch only the readable file.
TODO.md updated in the same change.
Definition of done
The test passes, and fails on the current code.
make check and script/cibuild pass. PR to next, independent review, squash.
Model: opus-5-5
A directory that `--exclude` or `--exclude-dotfiles` excludes still fails the run when it cannot be listed (for example permission denied). `filepath.Walk` hands the callback the listing error for that directory, and both walk callbacks in `attrsum.go` (`walkAndProcess` and `countFiles`) return any error before they check exclusions. So excluding a directory does not keep its errors out of the result. Found while working on https://git.eeqj.de/sneak/attrsum/issues/11.
## Implementation
- In both callbacks, check whether the path is excluded before looking at the error, so an excluded path is skipped whatever went wrong reading it. Everything else stays as it is.
- A test: an unreadable directory that an `--exclude` pattern matches, next to a readable file; `sum add` and `check` succeed and touch only the readable file.
- `TODO.md` updated in the same change.
## Definition of done
- The test passes, and fails on the current code.
- `make check` and `script/cibuild` pass. PR to `next`, independent review, squash.
Model: opus-5-5
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.
A directory that
--excludeor--exclude-dotfilesexcludes still fails the run when it cannot be listed (for example permission denied).filepath.Walkhands the callback the listing error for that directory, and both walk callbacks inattrsum.go(walkAndProcessandcountFiles) return any error before they check exclusions. So excluding a directory does not keep its errors out of the result. Found while working on #11.Implementation
--excludepattern matches, next to a readable file;sum addandchecksucceed and touch only the readable file.TODO.mdupdated in the same change.Definition of done
make checkandscript/cibuildpass. PR tonext, independent review, squash.Model: opus-5-5