Record the maintainer's answers: goal 5.7's test is a part that does nothing where written, null alone on stdin is misuse, and the CLI reads only the public API
This commit is contained in:
@@ -41,6 +41,7 @@ In [docs/decisions.md](docs/decisions.md):
|
||||
- Flags follow getopt_long
|
||||
- A struct tag is a template by its shape
|
||||
- The CLI renders exactly the template on its stdin, and adds nothing
|
||||
- The CLI reads only the library's public API
|
||||
- A template that does not compile is misuse (exit 2), including a reference that resolves to nothing, save a lone reference under the CLI's `--format` until item 129
|
||||
- Whitespace around a JSON template is dropped, in `NewTemplate` and on stdin
|
||||
- `FakeTemplate` and `NewTemplate` both stay
|
||||
|
||||
@@ -908,8 +908,10 @@ Where the project is heading; the sections before Audience document what ships t
|
||||
5. `[SE]` selects one row of a table, and means that row wherever you write it.
|
||||
6. If two people could read a template differently, loading it fails, and the
|
||||
error shows how to write each meaning.
|
||||
7. A spelling that suggests you meant something else — such as a range with nothing
|
||||
to draw, `int(5,5)` — fails to load, and the error shows what to write.
|
||||
7. A spelling that suggests you meant something else fails to load, and the error
|
||||
shows what to write. Such a spelling holds a part that does nothing where it is
|
||||
written, such as a range with nothing to draw, `int(5,5)`; a default written out
|
||||
is not one.
|
||||
8. When a clearer name turns up, it replaces the old one, even if that needs a new
|
||||
major version.
|
||||
9. Everything fejkdata renders is written as a template: on the command line, in a
|
||||
|
||||
+9
-1
@@ -85,7 +85,7 @@ adding one: a rule a user states in one sentence, at the cost of `printf` or a
|
||||
A JSON template is its JSON, so the whitespace around it is no part of the template, per
|
||||
the decision "Whitespace around a JSON template is dropped, in `NewTemplate` and on
|
||||
stdin". Stdin holding only whitespace is misuse, since an unset variable sends just a
|
||||
newline.
|
||||
newline, and so is stdin holding only `null`, which `jq` prints for a missing key.
|
||||
|
||||
A lone reference, `{/users}` or `"{/users}"`, names the record `users` under `--format`,
|
||||
one newline after it allowed, with `users` the default `--table`; one to nothing there
|
||||
@@ -98,6 +98,14 @@ piped in otherwise; so is a terminal with nothing piped in, which would otherwis
|
||||
typed input. `--list` prints paths, each read as `{/path}`. Valid while the CLI reads one
|
||||
template per run.
|
||||
|
||||
## The CLI reads only the library's public API
|
||||
|
||||
2026-10-07, Lilleman auf Larv. Serves goal 9.6: a CLI carrying your own modules is a few
|
||||
lines of Go and works just like `fejkdata`, so `fejkdata`'s own CLI is such a CLI and
|
||||
imports nothing under `internal/`. Where it needs a reading the API does not export yet,
|
||||
it copies it, and a test pins the copy to the grammar it copies: `isPath` in
|
||||
`cmd/fejkdata`, until `todo.md` item 129 moves the lone reference into the library.
|
||||
|
||||
## A template that does not compile is misuse (exit 2), including a reference that resolves to nothing, save a lone reference under the CLI's `--format` until item 129
|
||||
|
||||
2026-09-24, Lilleman auf Larv.
|
||||
|
||||
Reference in New Issue
Block a user