-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from hofstadter-io/adhoc-datafiles
hof/gen: support datafiles in adhoc mode
- Loading branch information
Showing
9 changed files
with
131 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
exec hof gen data.cue -T =all.yaml | ||
cmp all.yaml expected-all.yaml | ||
|
||
exec hof gen data.cue -T :vals=vals.yaml | ||
cmp vals.yaml expected-vals.yaml | ||
|
||
exec hof gen data.cue schema.cue -T =all.yaml | ||
cmp all.yaml expected-all.yaml | ||
|
||
-- schema.cue -- | ||
vals: [...{ name: string, data: int }] | ||
-- data.cue -- | ||
foo: "bar" | ||
vals: [{ | ||
name: "a" | ||
data: 1 | ||
},{ | ||
name: "b" | ||
data: 2 | ||
}] | ||
-- expected-all.yaml -- | ||
foo: bar | ||
vals: | ||
- name: a | ||
data: 1 | ||
- name: b | ||
data: 2 | ||
-- expected-vals.yaml -- | ||
- name: a | ||
data: 1 | ||
- name: b | ||
data: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
exec hof gen data.cue -T :vals='[]{{ .name }}.yaml' | ||
cmp a.yaml expected-a.yaml | ||
cmp b.yaml expected-b.yaml | ||
|
||
-- data.cue -- | ||
vals: [{ | ||
name: "a" | ||
data: 1 | ||
},{ | ||
name: "b" | ||
data: 2 | ||
}] | ||
|
||
-- expected-a.yaml -- | ||
name: a | ||
data: 1 | ||
-- expected-b.yaml -- | ||
name: b | ||
data: 2 |