Commit Graph

42 Commits

Author SHA1 Message Date
lilleman 5d33f4c0f0 Rename the builtin kind from generator to sample
Tests / vet + fmt + tests (pull_request) Successful in 32s
2026-09-01 21:41:35 +02:00
lilleman 04b7b6a432 Rename the exported type to Generator and retire the faker wording
Tests / vet + fmt + tests (pull_request) Successful in 25s
2026-09-01 21:34:27 +02:00
lilleman d44c941a92 Make the CI gate work on Gitea by building instead of bind-mounting
Tests / vet + fmt + tests (pull_request) Successful in 27s
Tests / vet + fmt + tests (push) Successful in 6s
2026-09-01 20:33:04 +02:00
lilleman 05dc042e49 Rename the project to fejkdata and record the fork source
Tests / vet + fmt + tests (pull_request) Failing after 6s
2026-09-01 20:24:03 +02:00
M 64a0d29496 Say why an empty name is rejected, and finish what that removed
Tests / vet + fmt + tests (push) Failing after 42s
The reason given was wrong. A dot path did reach an empty-named field:
Fake("a.") returned it, Fake("a.b.") returned a nested one, and {..a.} bound
it. What was true is narrower — List never offered it, because an empty name
is no path segment — so the engine accepted spellings it would not advertise.
The message, the test comment and the README say that instead.

Two things the rejection finished off:

A {} token still reported "no field \"\"", pointing at a fix the loader now
rejects — two errors for one rule. It is told the name can never exist, like
an option token already is.

addressable is dead: both halves of "not empty and no dot" are now rejected
where a name is authored. Mutating it to panic leaves the suite green here
and panics on main, so it was live and is not. Keeping it would preserve the
silent-hiding this change removes — List quietly omitting a name rather than
New refusing it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-01 07:31:18 +02:00
M 4b3dd011fc Pin the per-head walk, and say where the hold stops
Sharing renders' seen set across heads left the suite green while silently
under-rejecting: the first head's walk marks the only route to the second
head's draw. This PR widens heads from the bound levels to every held name,
so two heads in one template is now the ordinary case; a rejected case whose
violation sits on the later head pins the scoping.

An operand rendering one field twice covers the revisit guard, taking
coverage to 97.8% against main's 97.4%.

The README said the two spellings are rejected alike without saying what the
hold follows, which is not true where the operand reaches its own field
through a reference. It now names the plain {field} tokens the walk follows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M 21e7af6c1f Hold what a calc operand's render settled, up to a reference
The fence pinned only the operand node, so a reference reaching into it drew
that value again: {net.v} was a load error while {..cat.net.v} loaded and
disagreed in 20 of 40 renders. The hold now covers what rendering the operand
settles inside itself, so both spellings of that shape are rejected.

The walk stops at a {..path} edge, where the operand's own value ends and a
shared source begins. cover stops there too, through named, so both halves of
the fence end at the same boundary — and two names drawing from one referenced
category stay two draws.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M f949550515 One spelling for an unvalidated builtin arg, and say what the hold buys
float's prep still swallowed ParseFloat's error three lines from the atoi that
had just been changed to report one — two spellings of "parse an arg the check
already validated". atof reports it the same way.

The README paragraph said a reference reaching through an operand is caught,
which the narrowed fence no longer does and should not: it says what the hold
pins instead. Restored the why the trimmed comment in expand had carried.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M 7e073462c8 Document the fence a calc operand gets, and trim two comments
The one-spelling section described a calc operand only as a route that
renders a level, so a reader could not predict that {..cat.net} beside
{calc(net * 2, 2)} is now a load error with no path token in sight. It says
so, and says what an operand's draw covers and what it leaves free.

Dropped the paragraph in checkBoundLevelsHeld that restated its own first
line and the loop below it, and the escape-analysis note in expand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 21:58:37 +02:00
M ac0309cf94 Say what a name may contain, and what a calc operand reads
The Computation section carried the caveat this branch removes — that a field
shown and used in a calc is drawn twice — so it now describes the hold
instead. The name rules name all four reserved characters rather than the
dot alone, in both the Data and Data format sections, and the alternation
entry says a repeated arm is a load error and points at weight.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 13:33:05 +02:00
M c1222eaf72 Label the error fences, and settle a tie by where the format writes it 2026-08-30 22:31:54 +02:00
M 32b9aa5c81 Aim a path token's render edge at what it renders 2026-08-30 22:31:54 +02:00
M 447cfae50a Hold a bound level against every route that renders it, and let a matching string be 2026-08-30 22:31:54 +02:00
M f7165274c7 Accept one spelling per draw, and reject a path into a repeating level 2026-08-30 22:31:54 +02:00
M e4b37091e4 Say that a path is held at every level 2026-08-30 22:31:54 +02:00
M d7c4f43135 Document the path token and the one-draw rule 2026-08-30 22:31:54 +02:00
Mikael Göransson e371d217f4 Say what the objectid category actually is, and re-flow the registry comment 2026-08-28 13:35:12 +02:00
lilleman 43d3a752b3 Retire the objectid builtin; ship it as data instead 2026-08-28 13:35:12 +02:00
M b14caae3a8 Reject options that cannot take effect, and skip entries that are not data 2026-08-28 13:27:32 +02:00
M aec0497ce5 Say what the triple-letter test and the escape rule actually cover 2026-08-28 13:24:07 +02:00
Mikael Göransson e73cb398ac Keep every legal compound surname reachable, and tighten the README wording 2026-08-28 13:24:07 +02:00
lilleman cd25aea6f1 Correct the format-string example, and stop Swedish name data composing a triple letter 2026-08-28 13:24:07 +02:00
lilleman ab9846c2ff Compile format strings at New instead of re-scanning them on every render 2026-08-28 13:20:07 +02:00
Mikael Göransson 362c484825 Advertise only spellable paths, and name what a choice's variants share 2026-08-28 13:15:14 +02:00
Mikael Göransson 1665b37cad Precompute each choice's shared paths so a dotted path stays O(1) 2026-08-28 13:15:14 +02:00
lilleman af5b8c9abd Require every choice variant to carry a path, and list only what Fake accepts 2026-08-28 13:15:14 +02:00
M e7bd363519 Run the tests in CI as a merge gate 2026-08-28 12:39:03 +02:00
lilleman 5b6480a094 Updates from reviewers 2026-06-09 10:03:53 +02:00
lilleman cee2f35a2c Add {calc()}: arithmetic over number literals and sibling fields 2026-06-09 07:59:29 +02:00
lilleman eaf99d4542 Add locale-neutral misc data: currency, country, language, timezone, mimetype, httpstatus, useragent, coordinate, emoji, car 2026-06-09 01:58:49 +02:00
lilleman cde56b7924 Add session-scoped seq() builtin; move uuid v4 from locales to misc only 2026-06-09 01:52:39 +02:00
lilleman ae41e6bb97 Add ID/checksum/numeric builtins and a misc data folder (uuid v4, mac, creditcard) 2026-06-09 01:25:41 +02:00
lilleman c0eac6538d Correct CLI: repeatable -data-path flag for dirs, dot path stays positional 2026-06-09 00:54:33 +02:00
lilleman 889b1fbf8b Replace positional CLI path with a repeatable -path flag 2026-06-09 00:47:01 +02:00
lilleman 862c5f8a23 Add CLI -repeat and -separator flags for emitting multiple values 2026-06-09 00:31:46 +02:00
lilleman 18de1b7004 Add {..path} references: render a node from elsewhere in the merged data root 2026-06-09 00:11:17 +02:00
lilleman 8db65ac598 Replace locale dirs with a data-folder namespace model: New([]paths), folder dot-paths, last-wins merge 2026-06-08 23:52:37 +02:00
lilleman acf7571334 Stuff 2026-06-08 23:35:51 +02:00
lilleman a765230d3b Add fakes CLI (cmd/fakes); document it README-first with an SQL template example 2026-06-08 22:04:18 +02:00
lilleman 3e1cd3ee2a Add repeat/separator templates; validate at compile time; support Go 1.22+ via GO_VERSION 2026-06-08 21:11:58 +02:00
lilleman 770dcd72f2 Add locale data categories: word, sentence, date, time, ssn, version, email, ip, company, color, url, uuid, username, price 2026-06-05 20:18:27 +02:00
lilleman 943a1d9f1b Add fakes library: recursive JSON template engine, i18n locales, Docker workflow 2026-06-05 19:51:18 +02:00