Format Markdown with prettier in make fmt and fmt-check (closes #23)
check / check (push) Successful in 2m19s

`make fmt` now runs prettier over the Markdown files after the Go
formatters, and `make fmt-check` fails when prettier would change one.
`package.json`, `yarn.lock`, `.prettierrc` and `.prettierignore` are the
`sneak/prompts` copies at `dd4027b`, except for `"private": true` in
`package.json` in place of the licence field. Both scripts find yarn the
way that repo's scripts do. `script/bootstrap` installs prettier with
`yarn install --frozen-lockfile`. When the yarn those scripts would run
is not 1.22.22, it installs yarn through corepack under node 22.17.0:
the node on `PATH` if it has that version, otherwise one installed
through nvm from a hash-checked archive. `README.md` and `TODO.md` are
reformatted once.

Model: opus-5-5
This commit was merged in pull request #25.
This commit is contained in:
2026-10-06 11:43:51 +02:00
parent 4666af1cc8
commit 8976a64832
9 changed files with 275 additions and 98 deletions
+34 -28
View File
@@ -1,7 +1,7 @@
[**attrsum**](https://git.eeqj.de/sneak/attrsum/) is a **Go
1.22** command-line utility that **adds, updates, verifies, and clears per-file
file content checksums stored in extended attributes (xattrs) on macOS (APFS) and
Linux**, released under the [WTFPL v2](http://www.wtfpl.net/).
[**attrsum**](https://git.eeqj.de/sneak/attrsum/) is a **Go 1.22** command-line
utility that **adds, updates, verifies, and clears per-file file content
checksums stored in extended attributes (xattrs) on macOS (APFS) and Linux**,
released under the [WTFPL v2](http://www.wtfpl.net/).
Original release 2025-05-08.
@@ -53,30 +53,33 @@ find /data -name "*.jpg" | attrsum sum add -
attrsum -q sum add DIR
```
| xattr key | meaning |
|---------------------------------------------|--------------------------------|
| `user.berlin.sneak.app.attrsum.checksum` | base-58 multihash (sha2-256) |
| `user.berlin.sneak.app.attrsum.sumtime` | RFC 3339 timestamp of checksum |
| xattr key | meaning |
| ---------------------------------------- | ------------------------------ |
| `user.berlin.sneak.app.attrsum.checksum` | base-58 multihash (sha2-256) |
| `user.berlin.sneak.app.attrsum.sumtime` | RFC 3339 timestamp of checksum |
Flags:
* `-v, --verbose` — per-file log output
* `-q, --quiet` — suppress all output except errors (no progress bar or summary)
* `--exclude PATTERN` — skip paths matching rsync/Doublestar glob
* `--exclude-dotfiles` — skip any path component that starts with `.`
- `-v, --verbose` — per-file log output
- `-q, --quiet` — suppress all output except errors (no progress bar or summary)
- `--exclude PATTERN` — skip paths matching rsync/Doublestar glob
- `--exclude-dotfiles` — skip any path component that starts with `.`
All commands display a progress bar with ETA and print a summary report to stderr on completion (unless `--quiet` is specified).
All commands display a progress bar with ETA and print a summary report to
stderr on completion (unless `--quiet` is specified).
`attrsum` **never follows symlinks** and skips non-regular files (sockets, devices, …).
`attrsum` **never follows symlinks** and skips non-regular files (sockets,
devices, …).
---
## Why?
Apple APFS and Linux ext3/ext4 **store no per-file content checksums**, so
silent data corruption can pass unnoticed. `attrsum` keeps a portable checksum **inside each file’s xattrs**, providing integrity
verification that travels with the file itself—no external database
required. Now you can trust a USB stick didn't eat your data.
silent data corruption can pass unnoticed. `attrsum` keeps a portable checksum
**inside each file’s xattrs**, providing integrity verification that travels
with the file itself—no external database required. Now you can trust a USB
stick didn't eat your data.
---
@@ -84,21 +87,25 @@ required. Now you can trust a USB stick didn't eat your data.
Future improvements under consideration:
- **Dry-run mode (`--dry-run`, `-n`)** — show what would be done without making changes
- **JSON output (`--json`)** — machine-readable output for scripting and integration
- **Parallel processing (`-j N`)** — use multiple goroutines for faster checksumming on large trees
- **Dry-run mode (`--dry-run`, `-n`)** — show what would be done without making
changes
- **JSON output (`--json`)** — machine-readable output for scripting and
integration
- **Parallel processing (`-j N`)** — use multiple goroutines for faster
checksumming on large trees
- **Exit code documentation** — formalize and document exit codes for scripting
---
## Contributing
* Author & maintainer: **sneak** – <sneak@sneak.berlin>
* Issues / PRs: <https://git.eeqj.de/sneak/attrsum/>
* Code must pass `make check`, which runs the tests and golangci-lint as
phases of the `Dockerfile` (Docker is required) and checks formatting
with `gofmt -s` and goimports.
* No CLA; contributions are under WTFPL v2.
- Author & maintainer: **sneak** – <sneak@sneak.berlin>
- Issues / PRs: <https://git.eeqj.de/sneak/attrsum/>
- Code must pass `make check`, which runs the tests and golangci-lint as phases
of the `Dockerfile` (Docker is required) and checks formatting with `gofmt -s`
and goimports for Go and prettier for Markdown. `make bootstrap` installs
goimports and prettier, and `make fmt` fixes what the check reports.
- No CLA; contributions are under WTFPL v2.
---
@@ -112,5 +119,4 @@ No formal Code of Conduct; be excellent to each other.
## License
*Everything is permitted.*
See [WTFPL v2](http://www.wtfpl.net/txt/copying/).
_Everything is permitted._ See [WTFPL v2](http://www.wtfpl.net/txt/copying/).