aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.h
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-16 20:23:03 +0200
committeruser <user@clank>2026-08-16 20:23:03 +0200
commit2182ef505c6f12545cf156cca85a629256c28c72 (patch)
tree75a53a5fe4715b65172a33df633dd382e3944528 /src/app.h
parentsl0ppty: docs that match the program (diff)
downloadslosh-2182ef505c6f12545cf156cca85a629256c28c72.tar.gz
slosh-2182ef505c6f12545cf156cca85a629256c28c72.tar.xz
slosh-2182ef505c6f12545cf156cca85a629256c28c72.zip
sl0ppty: layouts are `*.layout.kdl`, and each loader says which it got
`config/layout.example.kdl` becomes `config/example.layout.kdl`, and the convention for the files people write is `project.layout.kdl`. Not a new extension, and the reason matters: the syntax genuinely *is* the same hand-rolled KDL subset for both documents -- one parser reads them -- so calling layouts something other than KDL would trade one wrong signal for another and lose every editor that highlights it. The confusion is about *schema*, so the schema goes in the stem: the extension says how to read the file, `.layout` says what is in it. `docker-compose.yml` and `tsconfig.json` settled this convention long ago. **But a filename cannot enforce anything, and that turned out to be the real bug.** `sl0ppty --check` on a layout file printed `ok` and reported "bindings 53" -- it had read a document containing nothing it understood and said so was fine. A config that `include`d a layout linted clean for the same reason. So did `rouded true`. The loader reads a document by *asking it for the keys it knows*, which is fast and clean and never notices what it was given. So it notices now. `KNOWN_TOP` is every node the loader reads, and anything else at the top level is a complaint with a file and line: s.kdl:2: unknown setting: rouded example.layout.kdl:14: this is a layout, not a config: `sl0ppty --layout` reads those sl0ppty: config.kdl: this is a config, not a layout: `gap` is a setting The `layout` node gets its own message because it is the mistake people actually make, and the reverse direction is the same list read backwards -- the layout loader asks `config_is_setting()` rather than keeping a guess of its own, so the two answers cannot disagree about which file is which. A layout whose own tabs are misspelled still gets "layout declares no tabs", which is a different mistake. D2 records it, since it is the decision that two schemas share one syntax. Verified: `tests/test_config.py` gained thirteen checks -- the unknown setting with its line, both wrong-schema messages, the misspelled-tabs case keeping its own, the shipped config linting clean and the shipped layout loading as one, and a drift guard that greps `kdl_child(root, ...)` out of the loader and fails if a setting is missing from `KNOWN_TOP` (verified by removing `gap_aspect` and watching it fail). Full suite green; my own config and the reference config both still lint clean, which is the thing this change could most easily have broken.
Diffstat (limited to 'src/app.h')
0 files changed, 0 insertions, 0 deletions