-
-
Notifications
You must be signed in to change notification settings - Fork 23
yaml diff Configuration File
William W. Kimball, Jr., MBA, MSIS edited this page Oct 29, 2020
·
1 revision
This document is part of the body of knowledge about yaml-diff, one of the reference command-line tools provided by the YAML Path project.
The yaml-diff
command-line tool accepts configuration in the form of command-line arguments and an INI-style configuration file. Users instruct yaml-diff
to read from their configuration file via the --config
or -c
command-line argument.
A configuration file for the yaml-diff
command supports these sections:
-
[defaults]
controls overarching (default) modes for the various comparison categories. -
[rules]
specifies YAML Paths and the comparison mode to be applied to that node and its child nodes (unless overridden by another rule). -
[keys]
defines identity key fields for Arrays-of-Hashes (AoHs) within the comparison data.
These sections are discussed with examples on the pages for each of the various types of data entities which yaml-diff
handles:
There is some potential for issues with this configuration file. These include:
- While the 3rd-Party Library used by
yaml-diff
to read user-specified configuration files can support:
as a delimiter between each key and its value, use=
, instead. Should any configuration line contain multiple=
symbols, it will still be correctly utilized byyaml-diff
. The same is not true should any line contain more than one:
. - All [rules] and [keys] are applied only to Right-Hand-Side (RHS) documents during the comparison process. Any rules created which would target only elements in the left-most document will have no effect during a comparison.
- The order of YAML Paths within the [rules] and [keys] sections from top-down is important. Later defined rules or keys override earlier definitions should any two entries target the same nodes within the comparison documents.
- Be particularly mindful of which nodes get targeted by YAML Paths within the [rules] section and which comparison mode gets applied to them. Some data element comparison modes are incompatible with nodes of the wrong data-type and will cause an error when improperly applied. For example, the
deep
mode for Array-of-Hash nodes is incompatible with Array nodes.