Sort JSON files to minimise git diffs

Sort and format JSON files to remove/minimise any diffs between
update-json runs. This also acts as a JSON validator to error when the
downloaded JSON file has been truncated.
This commit is contained in:
Guy Taylor
2019-04-04 18:06:13 +01:00
committed by Sebastian Thiel
parent 93dba234dd
commit 7467f81594
3 changed files with 32 additions and 1 deletions

View File

@@ -194,9 +194,10 @@ help${agsuffix}:
url = info['discoveryRestUrl'].replace("$", "$$")
json_api_targets.append(fake_target)
%>\
${fake_target}:
${fake_target}: $(PYTHON_BIN)
@mkdir -p ${target_dir}
@-curl --silent --show-error --fail --retry 3 -o '${target}' '${url}'
$(PYTHON) $(SORT_JSON_FILE) --skip-missing-file '${target}'
% endfor
update-json: ${' '.join(json_api_targets)}