Commit graph

4 commits

Author SHA1 Message Date
Rusty Russell
63aa76501a check_quotes.py: add --coverage tracking; add devtools/bolt-coverage.py.
check_quotes.py gains --coverage=FILE: on each successful match, atomically
appends one line '{bolt} {section_idx} {start} {end}' to FILE using a single
os.write() call so parallel make invocations don't interleave records.

find_quote() and find_quote_immediate() are updated to return match start
positions (needed to record the covered range, not just the end).

bolt-coverage.py reads the coverage file and reports BOLT text not covered
by any source comment.  By default it restricts output to Requirements
sections; --all-sections shows every section.  --bolt N restricts to
a single BOLT number.

Exit status is 0 if everything in the selected sections is covered, 1 if
anything is uncovered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 12:17:43 +09:30
Rusty Russell
07d1db0002 BOLT quotes: split cross-section quotes; prepare for new ... semantics.
The new check_quotes.py tool will treat `...` at the start of a quote as
"immediately follows previous quote in BOLT text". To prepare for that,
we change existing quotes which used leading `...` to mean "skip some
text": split them into two consecutive BOLT comments (the second starting
with `...` to use the existing wildcard match), and add explicit `*...`
markers between consecutive BOLT test vector sections which cross `# From`
headers.

Also remove leading `...` from nonce quotes in cryptomsg.c/handshake.c
where the actual BOLT text starts a fresh sentence (no prior quote in file).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
sCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 12:17:43 +09:30
Rusty Russell
12c3e2eab8 devtools/check_quotes.py: add -k option, make ... more nuanced.
Splits BOLT files into per-section chunks so wildcards can't inadvertently
cross section headers, supports `...`-at-start semantics, and adds make-style `-k`

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-04-30 12:17:43 +09:30
Rusty Russell
63c433c2e2 devtools: import check_quotes.py from lnprototest.
The Python tool (copied from lnprototest) handles multiple comment styles.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-04-30 12:17:43 +09:30