Skip to content

Commit

Permalink
tiltfile/yaml: encode empty lists as empty lists instead of null (#3568)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Miller committed Jul 9, 2020
1 parent 3c55cf6 commit c133ff8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/tiltfile/encoding/starlark.go
Expand Up @@ -61,7 +61,7 @@ func convertStarlarkToStructuredData(v starlark.Value) (interface{}, error) {
case starlark.Float:
return float64(v), nil
case *starlark.List:
var ret []interface{}
ret := []interface{}{}

it := v.Iterate()
defer it.Done()
Expand Down
4 changes: 3 additions & 1 deletion internal/tiltfile/encoding/yaml_test.go
Expand Up @@ -305,6 +305,7 @@ key5: 3
key6:
- foo
- 7
key7: []
'''
observed = encode_yaml({
'key1': 'foo',
Expand All @@ -316,7 +317,8 @@ observed = encode_yaml({
'key6': [
'foo',
7,
]
],
'key7': []
})
load('assert.tilt', 'assert')
Expand Down

0 comments on commit c133ff8

Please sign in to comment.