Refuse a blank TSV line, fence a table's family through any template, resolve a path before drawing, clamp the weighted pick, and say which countries and currencies the tables hold
Tests / vet + fmt + tests (pull_request) Successful in 1m8s
Tests / Gitea release from CHANGELOG.md (pull_request) Has been skipped

This commit is contained in:
2026-09-17 13:15:33 +02:00
parent df52566a6a
commit 7abd3e2d95
8 changed files with 100 additions and 67 deletions
+22
View File
@@ -144,12 +144,34 @@ func (c *drawCheck) checkDraws(path string, n node) error {
for _, e := range renderEdges(t) {
w.edge(t, e, drawAt{group: t.drawGroupKey, route: drawRoute{e.reached(), e.label}})
}
if err := w.checkOwnFamily(t); err != nil {
return fmt.Errorf("%s: %w", path, err)
}
if err := w.check(); err != nil {
return fmt.Errorf("%s: %w", path, err)
}
return nil
}
// checkOwnFamily refuses a table's format or cell that reads, however many templates
// away, a table of its own family: a row rendered whole draws its row without
// pinning it, so the family would draw apart from the row being rendered.
func (w *drawWalk) checkOwnFamily(t *template) error {
own := t.table
if own == nil {
own = t.cellOf
}
if own == nil {
return nil
}
for _, r := range w.reads {
if r.tr != nil && r.tr.head.family() == own.family() {
return fmt.Errorf("%s reads %s, a table of its own family, which a row of %s rendered whole would draw apart from; read the family from a template beside it, or add the value as a column", r.at.route.spelled(r.a.name), r.tr.head.category, own.category)
}
}
return nil
}
// checkRecordDraws fences the columns of a record — a template compiled at the top without a
// repeat — so a load proves the record view of it as well as the string view.
func (c *drawCheck) checkRecordDraws(path string, n node) error {