diff --git a/AGENTS.md b/AGENTS.md index 3a96aa5..fb36ce3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,7 +24,7 @@ before paraphrasing it, and name the register you read before claiming none publishes a spelling. - A README example is a `json` block that loads and renders as a category; `readme_test.go` runs every one. -- Cyclomatic complexity is gated at 14. Split a function that would go over it, except a table-shaped dispatch at 14, a switch with one case per kind of its input, which stays whole. +- Cyclomatic complexity is gated at 14: split a function that would go over it. A table-shaped dispatch, a switch with one case per kind of its input, may sit at 14 and stays whole. # Decisions diff --git a/graph.go b/graph.go index d9ddb5f..3004770 100644 --- a/graph.go +++ b/graph.go @@ -8,10 +8,10 @@ import ( "github.com/larvit/fejkdata/internal/invariant" ) -// eachNode visits n and every node inside it once, passing fn the label an error names each -// by: the dot path reaching it, then ", line N" for a table cell. It never crosses a -// reference edge — a {/path} reference is skipped — so a single inline node is walked on -// its own. +// eachNode visits n and every node inside it once, and passes fn each node with the label an +// error uses for it: the dot path reaching it, then ", line N" for a table cell. It never +// crosses a reference edge — a {/path} reference is skipped — so a single inline node is +// walked on its own. func eachNode(n node, label string, fn func(label string, n node) error) error { seen := map[node]bool{} var visit func(string, node) error diff --git a/table.go b/table.go index 47b7808..00e1b32 100644 --- a/table.go +++ b/table.go @@ -436,8 +436,8 @@ func (t *table) proveParent(siblings map[string]node) (*table, error) { return p, nil } -// checkAncestors refuses a cycle in the chain of parents from p, t's parent, and an ancestor -// with a column named like t. +// checkAncestors refuses a cycle in the chain of parents starting at p, t's parent, and +// refuses an ancestor that has a column named like t. func (t *table) checkAncestors(p *table, siblings map[string]node) error { var ancestors []*table for q, seen := p, map[*table]bool{t: true}; q != nil; q, _ = siblings[q.header[q.parentIndex]].(*table) { diff --git a/todo.md b/todo.md index 0934939..506dc37 100644 --- a/todo.md +++ b/todo.md @@ -469,7 +469,7 @@ Its doc says render failure, and it wraps what `NewTemplate` and `NewRecordTempl ### 116. Turn a row index into its rows file's line in one function. -Today `namedNode`'s cell line in `graph.go` and each error in `table.go` add the header line and the one-based count. Item 102 moves the rows into `internal/rows`; the function goes with them. +Today `namedNode`'s cell line in `graph.go` and each site in `table.go` add the header line and the one-based count. Item 102 moves the rows into `internal/rows`; the function goes with them. ### 56. Build on a manual run of `test.yml`.