Makefile: add check-requirements-coverage
What changed, and why it matters
This commit only adds a new Makefile target that reports which sections of the Bitcoin Lightning specification (BOLTs) are not yet quoted or covered by the codebase. It does not change any running code, network behavior, or security logic, so it has no direct security impact.
No security action needed; treat as normal build/CI tooling improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch introduces BOLT_COVERAGE_FLAGS and a new check-requirements-coverage Makefile target. When COVERAGE_FILE is set, existing bolt-check* rules pass it to devtools/check_quotes.py, then devtools/bolt-coverage.py produces a coverage report. This is purely a development/CI tooling change.
Changed components
MakefileInspect captured patch +13 / −3
diff --git a/Makefile b/Makefile
index 7d835fcc..682e3f36 100644
--- a/Makefile
+++ b/Makefile
@@ -567,15 +567,17 @@ endif
CHECK_QUOTES := devtools/check_quotes.py
+BOLT_COVERAGE_FLAGS=$(if $(COVERAGE_FILE),--coverage=$(COVERAGE_FILE),)
+
# Any mention of BOLT# must be followed by an exact quote, modulo whitespace.
bolt-check/%: % bolt-precheck
- @if [ -d .tmp.lightningrfc ]; then uv run $(CHECK_QUOTES) -k $(CHECK_BOLT_COMMIT) --comment-start "/* " --comment-continue "*" --comment-end "*/" --boltdir .tmp.lightningrfc $<; else echo "Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist" >&2; fi
+ @if [ -d .tmp.lightningrfc ]; then uv run $(CHECK_QUOTES) -k $(CHECK_BOLT_COMMIT) --comment-start "/* " --comment-continue "*" --comment-end "*/" --boltdir .tmp.lightningrfc $(BOLT_COVERAGE_FLAGS) $<; else echo "Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist" >&2; fi
bolt-check-py/%: % bolt-precheck
- @if [ -d .tmp.lightningrfc ]; then uv run $(CHECK_QUOTES) -k $(CHECK_BOLT_COMMIT) --boltdir .tmp.lightningrfc $<; else echo "Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist" >&2; fi
+ @if [ -d .tmp.lightningrfc ]; then uv run $(CHECK_QUOTES) -k $(CHECK_BOLT_COMMIT) --boltdir .tmp.lightningrfc $(BOLT_COVERAGE_FLAGS) $<; else echo "Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist" >&2; fi
bolt-check-rs/%: % bolt-precheck
- @if [ -d .tmp.lightningrfc ]; then uv run $(CHECK_QUOTES) -k $(CHECK_BOLT_COMMIT) --comment-start "// " --comment-continue "//" --boltdir .tmp.lightningrfc $<; else echo "Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist" >&2; fi
+ @if [ -d .tmp.lightningrfc ]; then uv run $(CHECK_QUOTES) -k $(CHECK_BOLT_COMMIT) --comment-start "// " --comment-continue "//" --boltdir .tmp.lightningrfc $(BOLT_COVERAGE_FLAGS) $<; else echo "Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist" >&2; fi
LOCAL_BOLTDIR=.tmp.lightningrfc
@@ -587,6 +589,14 @@ RUSTSRC=$(shell git ls-files "*.rs")
check-source-bolt: $(ALL_NONGEN_SRCFILES:%=bolt-check/%) $(PYSRC:%=bolt-check-py/%) $(RUSTSRC:%=bolt-check-rs/%)
+check-requirements-coverage: bolt-precheck
+ @if [ ! -d .tmp.lightningrfc ]; then echo "Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist" >&2; exit 1; fi
+ @f=/tmp/cln-bolt-coverage.$$$$; \
+ rm -f $$f; \
+ $(MAKE) check-source-bolt COVERAGE_FILE=$$f && \
+ uv run devtools/bolt-coverage.py --coverage $$f --boltdir .tmp.lightningrfc; \
+ rc=$$?; rm -f $$f; exit $$rc
+
check-whitespace/%: %
@if grep -Hn '[ ]$$' $<; then echo Extraneous whitespace found >&2; exit 1; fi
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.