cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

Contributor docs: the docs checks, tapes and where facts go

Dami committed 24a404b
testing.md describes doccheck and the docs tests, says how tapes reach
commands and when docs/media is updated, and loses a repeated paragraph
on test config directories. UX.md's checklist asks for the feature's
doc and keys.md rather than a README keys table that doesn't exist.
CLAUDE.md names doccheck and the one-home rule. data.md gives Alt+A for
replace all, which the find bar takes. The charts tape reaches Insert >
Chart through the palette: its menu position changed.
commit
24a404b3bed868bd1ff266af1ad578df0284bc4f
parent
e389ff447c3d071a77e1915edc64cc00d0863ba9
author
Dami <dami.etoile@gmail.com>
5 files changed, +57 -30
MCLAUDE.md8+++-
Mdemos/charts.tape11++---
Mdocs/UX.md5++-
Mdocs/data.md2+-
Mdocs/testing.md61++++++++++++++++++++----------
M CLAUDE.md +6 -2
M demos/charts.tape +5 -6
M docs/UX.md +4 -1
M docs/data.md +1 -1
M docs/testing.md +41 -20
@@ -2,7 +2,7 @@
22 33 ```sh44 make check # all of the below that must pass before a push: gofmt, vet, lint, test, oracle, e2e5-make lint # go vet, staticcheck, cognitive complexity at most 25, Go files at most 500 lines, doclint (docs describe the code, not its history)5+make lint # go vet, staticcheck, cognitive complexity at most 25, Go files at most 500 lines, doclint and doccheck (see Docs below)66 make test # engine, file formats and UI unit tests77 make fuzz # fuzz the formula parser and the CSV, .wk1 and XLSX readers88 make oracle # compare formulas and number formats with excelize
@@ -28,21 +28,18 @@ Ghostty would send. Tests assert on what a user would see: screen text,
2828 cursor position, window title, hyperlinks, which screen is active after2929 quitting. A fake TypeSafe server answers JEV questions, and the harness3030 clears `TYPESAFE_API_KEY` so tests never reach the real service. Every31-session gets its own config directory (`XDG_CONFIG_HOME`, with an32-optional config file), and the binary is built with `-tags fakekeyring`,33-whose credential store is a file there, so tests never read your config34-or touch your keychain. Unit tests do the same with `ui.Settings` and35-`keyring.Memory`.31+session points `XDG_CONFIG_HOME` into its working directory (with an32+optional config file), so its config, theme files and the machine id33+that macros' trust uses are the test's own: sessions that share a34+directory are one computer. The binary is built with `-tags35+fakekeyring`, whose credential store is a file there, so tests never36+read your config or touch your keychain. Unit tests do the same with37+`ui.Settings` and `keyring.Memory`.3638 3739 `e2e/ssh_test.go` runs `012 serve` and reaches it with the system's3840 `ssh` client inside the same libghostty terminal, so the server path3941 is tested as a user sees it (skipped when `ssh` isn't installed).4042 41-Each session points `XDG_CONFIG_HOME` into its working directory, so its42-config file, theme files and the machine id that macros' trust uses are43-the test's own: sessions that share a directory are one computer, and44-tests never touch the real config, keychain or machine id.45-4643 `make e2e` builds libghostty-vt from source with Zig into `.deps/` on first4744 use. It is its own Go module so cgo never reaches the main binary.4845
@@ -67,8 +64,8 @@ reason.
6764 ## The XLSX differential test6865 6966 `TestXLSXDifferential` (`internal/fileio/xlsx_diff_test.go`) imports a70-corpus of workbooks with 012's own XLSX reader and with the excelize71-importer it replaced (kept in `xlsx_excelize_test.go`), and compares67+corpus of workbooks with 012's own XLSX reader and with an importer68+built on excelize (`xlsx_excelize_test.go`), and compares7269 every sheet as saved, the widths, names, sheet shown, rows and notes.7370 The corpus is workbooks written by the test (hand-written SpreadsheetML,7471 excelize and 012's exporter), the stress datasets' XLSX files when
@@ -86,13 +83,37 @@ service one question of each kind, using `TYPESAFE_API_KEY`.
8683 ## Demo recordings8784 8885 `demos/` holds [VHS](https://github.com/charmbracelet/vhs) tapes for the89-recordings in the README. `make demos` renders all of them (or90-`make demos DEMOS=jev` for one) into `demos/out/`: full GIFs, PNG stills of91-key moments in `demos/out/stills/`, and smaller GIFs in `demos/out/media/`.92-It needs vhs 0.12+, ttyd and ffmpeg. The JEV tape talks to `demos/fakejev`, a93-local stand-in the target starts on 127.0.0.1, never the real service. On94-macOS, `demos/lib/ttyd` wraps ttyd so Alt+letter reaches the app. VHS has no95-mouse commands, so the tapes use the keyboard.86+recordings and stills the README and the docs show. `make demos` renders87+all of them (or `make demos DEMOS=jev` for one) into `demos/out/`: full88+GIFs, PNG stills of key moments in `demos/out/stills/`, and smaller GIFs89+in `demos/out/media/`. It needs vhs 0.12+, ttyd and ffmpeg. The JEV tape90+talks to `demos/fakejev`, a local stand-in the target starts on91+127.0.0.1, never the real service. On macOS, `demos/lib/ttyd` wraps ttyd92+so Alt+letter reaches the app. VHS has no mouse commands, so the tapes93+use the keyboard, and they reach commands through the palette (Ctrl+K)94+rather than counting menu items, so a new menu item doesn't break them.95+Tapes that change settings set them for the run (`O12_KEYMAP=vim`)96+rather than writing the config file the other tapes share.97+98+A change to what a tape shows means rendering it again, reading its99+stills, and copying what the docs show into `docs/media/`: GIFs from100+`demos/out/media/`, stills from `demos/out/stills/`. Only files a doc101+shows go there, and GIFs stay under 1 MB.102+103+## Docs104+105+`make lint` runs `scripts/doclint`, which flags wording that narrates106+history (see [CLAUDE.md](../CLAUDE.md)), and `scripts/doccheck`: relative107+links and anchors resolve, [docs/README.md](README.md) links every doc,108+every file in `docs/media` is shown by a doc and made by a tape, and109+every tape records something a doc shows. Unit tests check what the docs110+say about the code: menu paths lead to menu items, command ids and keys111+exist and every bound key is in [keys.md](keys.md)112+(`internal/ui/docs_test.go`), settings and variables are options113+(`internal/config/docs_test.go`), and [files.md](files.md) names every114+field of the format (`internal/sheet/file_doc_test.go`).115+[functions.md](functions.md) and [config.md](config.md)'s reference are116+generated, and their tests fail when they're stale.96117 97118 ## No broken windows98119