Move to JSON as the metadata format for DiffX.
Review Request #11702 — Created July 5, 2021 and submitted
Initially, DiffX was envisioned as having a YAML-style metadata format.
This was an attempt to keep the appearance of metadata similar to that
of several diff variants, such as Git-style diffs. However, none of
these variants had any sort of grammar defined for their format. They
were just entirely ad-hoc.We couldn't depend on YAML itself, due to numerous parser
inconsistencies. A home-grown grammar was defined, but this would be yet
another custom structured data format, and this seemed to be the wrong
place to introduce this.Instead, we're now using JSON as the metadata format. This has a couple
significant advantages:
JSON is widely available in nearly any language, and through command
line tools, making it very easy to support.No part of JSON output should conflict with the syntax of DiffX,
unified diffs, or any known custom diff format.This change updates the spec to make it clear that JSON is the official
format used for DiffX, and to update all the example diffs and metadata
to use it.
Built the docs. Checked all the example diffs and metadata examples to
ensure they had correct syntax and was rendering correctly.
Summary | ID |
---|---|
a936062472b27c83d13722c817abfe34c39d8fab |
Description | From | Last Updated |
---|---|---|
Maybe put "json" first in the list? We should probably also highly recommend that this option is included, even though … |
david | |
F401 'pygments.token.Punctuation' imported but unused |
reviewbot | |
F401 'pygments.token.Operator' imported but unused |
reviewbot | |
F401 'pygments.token.String' imported but unused |
reviewbot |
- Change Summary:
-
Changes to the
format
option:- It's now a recommendation instead of a reserved option.
- Removed the list of possible options, in favor of a single valid option:
json
. - Added information on the requirements of diff parsers and generators when it comes to this option, or the lack of the option in a
meta
section. - Specified that new format options will only be introduced when bumping the spec version.
- Commits:
-
Summary ID 5331db232b2d8a6e19637cbc93dfd8554dc3b61f a936062472b27c83d13722c817abfe34c39d8fab - Diff:
-
Revision 2 (+800 -614)