Commit Graph
9 Commits
Author SHA1 Message Date
clawbot 9e55fd7113 Print the byte unit once in the summary line (closes #17)
check / check (push) Successful in 2m13s
formatBytes already ends in a unit, so the summary line read "9 B
bytes" or "1.0 KiB bytes". The format string in Stats.Print no longer
adds the word "bytes".

Print now takes the io.Writer to print to; its callers pass os.Stderr,
and the new test passes a buffer to read the line for one small and
one large byte count.

Model: opus-5-5
2026-10-06 08:27:08 +02:00
clawbot c4b50e2b55 Skip excluded paths before looking at their errors (closes #16)
check / check (push) Successful in 4m10s
filepath.Walk hands its callback the error for a path it could not
read, such as a directory it cannot list. Both callbacks, in
walkAndProcess and countFiles, returned that error before they checked
the exclusions, so a directory that --exclude or --exclude-dotfiles
excluded still failed the run when it could not be listed. Given an
error, each callback now checks the exclusions first and skips an
excluded path. The new test excludes a directory that cannot be listed
and runs sum add and check over its parent.

Model: opus-5-5
2026-10-06 07:44:00 +02:00
clawbot d010135618 Run lint and tests as phases of the Dockerfile (closes #5)
check / check (push) Successful in 2m45s
The Dockerfile gets a lint phase on the pinned golangci-lint v2.12.2
image and a test phase on the Debian Go image. The tests run as an
unprivileged user, because root reads a file with mode 0000 and the
permission test then fails. The build stage copies a file from each
phase, so no build finishes unless both pass, and it no longer runs
make check. script/lint and script/test each build their phase,
uncached and tagged; script/cibuild bootstraps, runs script/check, then
builds the image. script/bootstrap no longer installs golangci-lint.
README.md and TODO.md describe the new setup.

Model: opus-5-5
2026-10-06 06:59:53 +02:00
clawbot 4fd857bc32 Keep going past unreadable files with check --continue (closes #11)
check / check (push) Successful in 2m1s
With --continue, check stopped at the first file whose content or
checksum attribute it could not read, and at the first directory it
could not list. Each of these now counts as failed, its error, which
names the path, goes to stderr, and the walk goes on; the run still
exits non-zero. The count that sizes the progress bar leaves such a
path out, so the bar stays. The walk and the count, shared with sum
and clear, take the continue setting; those commands pass false and
still stop at the first error. Without --continue the first such error
still stops the run, and the summary printed before it now counts an
unreadable checksum attribute as failed, as it already did for
unreadable content.

Model: opus-5-5
2026-10-06 05:44:04 +02:00
clawbot 30b36dabe4 Make the golangci-lint settings take effect: v2 config layout, linter pinned at v2.12.2 (closes #10)
check / check (push) Successful in 3m32s
golangci-lint v2 ignores a top-level linters-settings block without a
warning, so limits such as the 88-column line length were never
applied. .golangci.yml is now the canonical copy from sneak/prompts,
verbatim, which keeps its settings under linters.settings and also
configures depguard and gomodguard_v2. golangci-lint is pinned at
v2.12.2 by commit in the Dockerfile and script/bootstrap. The long
lines in attrsum.go are rewrapped and one nolint directive moves to
its own line; behaviour is unchanged.

Model: opus-5-5
2026-10-06 03:26:51 +02:00
clawbot 6a0dfa9f2c Run make try against a temporary directory (closes #12)
check / check (push) Successful in 3m36s
`make try` ran against a fixed directory on one person's machine. It
failed for anyone else, and where that directory existed it rewrote the
checksum attributes and modification times of real files.

It now writes three small files into a new directory from `mktemp -d`,
runs the same sequence of commands on it, and removes it with an EXIT
trap. All steps run in one shell, so the trap also removes the
directory when a step fails.

`TODO.md`: the `try` sentence leaves Next Step and is recorded under
Completed Steps.

Model: opus-5-5
2026-10-06 01:59:55 +02:00
clawbot 9f3af05c91 Report the version: docker build . stamps the git tag or short commit (closes #7)
check / check (push) Successful in 59s
attrsum --version now prints the git tag or short commit. make build
stamps it with -X from git describe, and the Dockerfile takes the VERSION
build argument when given, otherwise git describe --tags --always on the
.git in the build context, failing if .git is present and no version
comes out. A new .dockerignore, the canonical one, keeps .git/config out
of the context, and also this repo's host-built /attrsum. CI checks out
full history so it sees the 1.0.0 tag and stamps what a full clone does.
script/docker is replaced with the canonical copy.

Model: opus-5-5
2026-10-02 11:02:38 +02:00
sneak 975116f13d Add standard Workflow section to TODO.md 2026-07-06 21:06:44 +02:00
sneak 1bf1c892f4 Add TODO.md 2026-07-06 20:35:51 +02:00