doc: reintroduce the fmt command to fmt the schema

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commit is contained in:
Vincenzo Palazzo 2022-02-05 14:38:18 +01:00 committed by Rusty Russell
parent 1ef77504b1
commit 11c94528b3
1 changed files with 4 additions and 0 deletions

View File

@ -93,10 +93,14 @@ doc-all: $(MANPAGES) doc/index.rst
SCHEMAS := $(wildcard doc/schemas/*.json)
check-fmt-schemas: $(SCHEMAS:%=check-fmt-schema/%)
fmt-schemas: $(SCHEMAS:%=fmt-schema/%)
check-fmt-schema/%: %
@jq . < "$*" > "$*".fmt && diff -u "$*" "$*.fmt" && rm "$*.fmt"
fmt-schema/%: %
@jq . < "$*" > "$*".fmt && cat "$*".fmt > "$*" && rm "$*.fmt"
check-doc: check-config-docs check-manpages check-fmt-schemas
# Some manpages use a schema, so need that added.