YAML anchors: this gives a name to a node (with &name)
YAML aliases: this refers to an anchor (with *name)
YAML merge key: this merges one hash with another (<< *name)
For example, this below will merge all attributes of the sum_of_three object with the stdout object:
stdout:
<<: *sum_of_three
data: "example"
The example below is an alias: the stdout object will be the same as the sum_of_three object:
stdout: *sum_of_three
Since this is purely YAML, you could also anchor the first use, instead of using the definitions object.
To be consistent, this PR also removes our own "inheritance" support for config values. The support for files is kept for now, as merging lists is not possible in a somewhat standard way (but we could introduce support for it with a custom tag at some point).
This PR enables a new object called
definitions
that can be used to define stuff and use it later:This is done by using three YAML features:
&name
)*name
)<< *name
)For example, this below will merge all attributes of the
sum_of_three
object with thestdout
object:The example below is an alias: the
stdout
object will be the same as thesum_of_three
object:Since this is purely YAML, you could also anchor the first use, instead of using the
definitions
object.To be consistent, this PR also removes our own "inheritance" support for config values. The support for files is kept for now, as merging lists is not possible in a somewhat standard way (but we could introduce support for it with a custom tag at some point).
Closes #394.