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
15 changes: 7 additions & 8 deletions internal/command/jsonformat/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ func (renderer Renderer) RenderHumanState(state State) {
return
}

opts := computed.RenderHumanOpts{
ShowUnchangedChildren: true,
HideDiffActionSymbols: true,
}
opts := computed.NewRenderHumanOpts(renderer.Colorize)
opts.ShowUnchangedChildren = true
opts.HideDiffActionSymbols = true

state.renderHumanStateModule(renderer, state.RootModule, opts, true)
state.renderHumanStateOutputs(renderer, opts)
Expand Down Expand Up @@ -119,11 +118,11 @@ func (r Renderer) RenderLog(log *JSONLog) error {
return err
}

opts := computed.NewRenderHumanOpts(r.Colorize)
opts.ShowUnchangedChildren = true

outputDiff := change.ComputeDiffForType(ctype)
outputStr := outputDiff.RenderHuman(0, computed.RenderHumanOpts{
Colorize: r.Colorize,
ShowUnchangedChildren: true,
})
outputStr := outputDiff.RenderHuman(0, opts)

msg := fmt.Sprintf("%s = %s", name, outputStr)
r.Streams.Println(msg)
Expand Down
7 changes: 7 additions & 0 deletions internal/command/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,13 @@ func TestShow_plan_json(t *testing.T) {

func TestShow_state(t *testing.T) {
originalState := testState()
root := originalState.RootModule()
root.SetOutputValue("test", cty.ObjectVal(map[string]cty.Value{
"attr": cty.NullVal(cty.DynamicPseudoType),
"null": cty.NullVal(cty.String),
"list": cty.ListVal([]cty.Value{cty.NullVal(cty.Number)}),
}), false)

statePath := testStateFile(t, originalState)
defer os.RemoveAll(filepath.Dir(statePath))

Expand Down