Skip to content

Commit cb5c857

Browse files
committed
doc: allow commits to suppress the schema checks.
The stupid requirement for JSON commas combines with our inability to annotate the removal or introduction of enum values and our naive check here, to produce a false positive. Allow commit messages to suppress. No-schema-diff-check: removed enum `websocket` as value type. Signed-off-by: Rusty Russell <[email protected]>
1 parent 9e2ec0d commit cb5c857

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

doc/Makefile

+12-7
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,23 @@ doc/index.rst: $(MANPAGES:=.md)
230230
# For CI to (very roughly!) check that we only deprecated fields, or labelled added ones
231231
# When running on GitHub (CI=true), we need to fetch origin/master
232232
schema-added-check:
233-
@if ! test -z $$CI; then git fetch origin master; fi; \
234-
if git diff origin/master -- doc/schemas | grep -q '^+.*{' && ! git diff origin/master -- doc/schemas | grep -q '^+.*"added"'; then \
235-
git diff origin/master -- doc/schemas; \
233+
@if ! test -z $$CI; then git fetch origin master; ROOT=FETCH_HEAD; else ROOT=master; fi; \
234+
if git show --format=%B -s $$ROOT.. | grep -q '^No-schema-diff-check'; then echo $@ suppressed; exit 0; fi; \
235+
if git diff $$ROOT -- doc/schemas | grep -q '^+.*{' && ! git diff $$ROOT -- doc/schemas | grep -q '^+.*"added"'; then \
236+
git diff $$ROOT -- doc/schemas; \
236237
echo 'New schema fields must have "added": "vNEXTVERSION"' >&2; exit 1; \
237238
fi
238239
schema-removed-check:
239-
@if ! test -z $$CI; then git fetch origin master; fi; \
240-
if git diff origin/master -- doc/schemas | grep -q '^-.*{' && ! git diff origin/master -- doc/schemas | grep -q '^-.*"deprecated"' && ! git diff origin/master -- doc/schemas | grep -q '^-.*EXPERIMENTAL_FEATURES'; then \
241-
git diff origin/master -- doc/schemas ; \
240+
@if ! test -z $$CI; then git fetch origin master; ROOT=FETCH_HEAD; else ROOT=master; fi; \
241+
if git show --format=%B -s $$ROOT.. | grep -q '^No-schema-diff-check'; then echo $@ suppressed; exit 0; fi; \
242+
if git diff $$ROOT -- doc/schemas | grep -q '^-.*{' && ! git diff $$ROOT -- doc/schemas | grep -q '^-.*"deprecated"' && ! git diff $$ROOT -- doc/schemas | grep -q '^-.*EXPERIMENTAL_FEATURES'; then \
243+
git diff $$ROOT -- doc/schemas ; \
242244
echo 'Schema fields must be "deprecated", with version, not removed' >&2; exit 1; \
243245
fi
244246

245-
schema-diff-check: schema-added-check schema-removed-check
247+
show-diff:
248+
@if ! test -z $$CI; then git fetch origin master; ROOT=FETCH_HEAD; else ROOT=master; fi; echo "DIFF from $$ROOT to here:"; git show --format=%B $$ROOT..
249+
250+
schema-diff-check: show-diff schema-added-check schema-removed-check
246251

247252
check-source: schema-diff-check

0 commit comments

Comments
 (0)