Skip to content

Commit 3a39c63

Browse files
committed
CI: rough check that schema changes seem to mention added, don't delete non-deprcated.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 717cb03 commit 3a39c63

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,14 @@ doc/index.rst: $(MANPAGES:=.md)
203203
sed 's/\(.*\)\.\(.*\).*\.md/\1 <\1.\2.md>/' | \
204204
python3 devtools/blockreplace.py doc/index.rst manpages --language=rst --indent " " \
205205
)
206+
207+
# For CI to (very roughly!) check that we only deprecated fields, or labelled added ones
208+
schema-added-check:
209+
@if git diff master doc/schemas | grep -q '^+.*{' && ! git diff master doc/schemas | grep -q '^+.*"added"'; then echo 'New schema fields must have "added": "vNEXTVERSION"' >&2; exit 1; fi
210+
211+
schema-removed-check:
212+
@if git diff master doc/schemas | grep -q '^-.*{' && ! git diff master doc/schemas | grep -q '^-.*"deprecated": "'; then echo 'Schema fields must be deprecated, with version, not removed' >&2; exit 1; fi
213+
214+
schema-diff-check: schema-added-check schema-removed-check
215+
216+
check-source: schema-diff-check

0 commit comments

Comments
 (0)