Skip to content

Commit

Permalink
doc: allow commits to suppress the schema checks.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rustyrussell committed May 30, 2023
1 parent 9e2ec0d commit bee38cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,14 @@ doc/index.rst: $(MANPAGES:=.md)
# When running on GitHub (CI=true), we need to fetch origin/master
schema-added-check:
@if ! test -z $$CI; then git fetch origin master; fi; \
if git show --format=%B -s origin/master.. | grep -q '^No-schema-diff-check'; then exit 0; fi; \
if git diff origin/master -- doc/schemas | grep -q '^+.*{' && ! git diff origin/master -- doc/schemas | grep -q '^+.*"added"'; then \
git diff origin/master -- doc/schemas; \
echo 'New schema fields must have "added": "vNEXTVERSION"' >&2; exit 1; \
fi
schema-removed-check:
@if ! test -z $$CI; then git fetch origin master; fi; \
if git show --format=%B -s origin/master.. | grep -q '^No-schema-diff-check'; then exit 0; fi; \
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 \
git diff origin/master -- doc/schemas ; \
echo 'Schema fields must be "deprecated", with version, not removed' >&2; exit 1; \
Expand Down

0 comments on commit bee38cf

Please sign in to comment.