Move to JSON as the metadata format for DiffX.

Review Request #11702 — Created July 5, 2021 and submitted — Latest diff uploaded

Information

DiffX
master

Reviewers

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:

  1. JSON is widely available in nearly any language, and through command
    line tools, making it very easy to support.

  2. 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.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Move to JSON as the metadata format for DiffX.
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: 1. JSON is widely available in nearly any language, and through command line tools, making it very easy to support. 2. 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.
5331db232b2d8a6e19637cbc93dfd8554dc3b61f Christian Hammond
docs/spec/section-format.rst
docs/spec/sections.rst
docs/spec/example-diffs/commit.diff
docs/spec/example-diffs/local-file.diff
docs/spec/example-diffs/multi-commit.diff
docs/spec/example-diffs/repo-file.diff
docs/spec/example-diffs/wrapped-cvs-diff.diff
docs/spec/example-diffs/wrapped-git-diff.diff
docs/spec/example-diffs/wrapped-svn-prop-diff.diff
python/setup.py
python/diffx/integrations/pygments_lexer.py
Loading...