Skip to content

Commit 7e07b9e

Browse files
denikIsaac
andcommitted
structvar: test the YAML decoder with the yamlloader fixtures
Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 83f8390 commit 7e07b9e

49 files changed

Lines changed: 1549 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 1. Basic Anchor and Alias
2+
defaults: &DEFAULTS
3+
color: red
4+
size: large
5+
6+
shirt1:
7+
<<: *DEFAULTS
8+
pattern: striped
9+
10+
shirt2:
11+
<<: *DEFAULTS
12+
pattern: plain
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 2. Merging Anchors
2+
# Here, multiple anchors can be merged into a single item.
3+
defaults: &DEFAULTS
4+
color: red
5+
size: large
6+
7+
materials: &MATERIALS
8+
primary: cotton
9+
secondary: polyester
10+
11+
shirt:
12+
<<: [*DEFAULTS, *MATERIALS]
13+
pattern: striped
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 3. Overriding Merged Anchor Values
2+
# You can override values when merging.
3+
defaults: &DEFAULTS
4+
color: red
5+
size: large
6+
pattern: plain
7+
8+
shirt:
9+
<<: *DEFAULTS
10+
color: blue
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 4. Nested Anchors
2+
# This demonstrates the reuse of nested content.
3+
address: &ADDRESS
4+
city: San Francisco
5+
state: CA
6+
country: USA
7+
8+
person1:
9+
name: Alice
10+
address: *ADDRESS
11+
12+
person2:
13+
name: Bob
14+
address:
15+
<<: *ADDRESS
16+
city: Los Angeles
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 5. Using Anchors for List Items
2+
# You can use anchors for list items too.
3+
features: &FEATURES
4+
- wifi
5+
- bluetooth
6+
7+
phone1:
8+
name: PhoneA
9+
features: *FEATURES
10+
11+
phone2:
12+
name: PhoneB
13+
features:
14+
- camera
15+
- *FEATURES
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 6. String Anchors
2+
commonMessage: &msg "Hello, World!"
3+
4+
greeting1: *msg
5+
greeting2: *msg
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 7. Number Anchors
2+
defaultAge: &age 25
3+
4+
person1:
5+
name: Alice
6+
age: *age
7+
8+
person2:
9+
name: Bob
10+
age: *age
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 8. Boolean Anchors
2+
isActive: &active true
3+
4+
user1:
5+
username: user1
6+
active: *active
7+
8+
user2:
9+
username: user2
10+
active: *active
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
anchortest: &x
2+
child: *x
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
leaf: &leaf 1
2+
shared: &shared
3+
value: *leaf
4+
use1: *shared
5+
use2: *shared

0 commit comments

Comments
 (0)