Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion functional-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,8 @@ bar: |-
r#"{
"foo": "bar",
"bar": "baz\nbam"
}"#
}
"#
);
}

Expand Down
2 changes: 2 additions & 0 deletions stores/json/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ func (store *Store) EmitEncryptedFile(in sops.Tree) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("Error marshaling to json: %s", err)
}
out = append(out, '\n')
return out, nil
}

Expand All @@ -340,6 +341,7 @@ func (store *Store) EmitPlainFile(in sops.TreeBranches) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("Error marshaling to json: %s", err)
}
out = append(out, '\n')
return out, nil
}

Expand Down
18 changes: 12 additions & 6 deletions stores/json/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ func TestDecodeJSON(t *testing.T) {
}
}
}
}`
}
`
expected := sops.TreeBranch{
sops.TreeItem{
Key: "glossary",
Expand Down Expand Up @@ -312,7 +313,8 @@ func TestEncodeJSONArrayOfObjects(t *testing.T) {
},
2
]
}`
}
`
store := Store{
config: config.JSONStoreConfig{
Indent: -1,
Expand Down Expand Up @@ -446,7 +448,8 @@ func TestIndentTwoSpaces(t *testing.T) {
},
2
]
}`
}
`
store := Store{
config: config.JSONStoreConfig{
Indent: 2,
Expand Down Expand Up @@ -488,7 +491,8 @@ func TestIndentDefault(t *testing.T) {
},
2
]
}`
}
`
store := Store{
config: config.JSONStoreConfig{
Indent: -1,
Expand Down Expand Up @@ -530,7 +534,8 @@ func TestNoIndent(t *testing.T) {
},
2
]
}`
}
`
store := Store{
config: config.JSONStoreConfig{
Indent: 0,
Expand Down Expand Up @@ -619,7 +624,8 @@ func TestComments(t *testing.T) {
},
2
]
}`
}
`
store := Store{
config: config.JSONStoreConfig{
Indent: 2,
Expand Down
Loading