diff --git a/internal/command/jsonformat/README.md b/internal/command/jsonformat/README.md index 0824382627..9ad502fcc4 100644 --- a/internal/command/jsonformat/README.md +++ b/internal/command/jsonformat/README.md @@ -1,10 +1,10 @@ # jsonformat This package contains functionality around formatting and displaying the JSON -structured output produced by adding the `-json` flag to various Terraform +structured output produced by adding the `-json` flag to various OpenTF commands. -## Terraform Structured Plan Renderer +## OpenTF Structured Plan Renderer As of January 2023, this package contains only a single structure: the `Renderer`. @@ -32,7 +32,7 @@ concerned with the complex diff calculations. The `differ` package operates on `Change` objects. These are produced from `jsonplan.Change` objects (which are produced by the `opentf show` command). Each `jsonplan.Change` object represents a single resource within the overall -Terraform configuration. +OpenTF configuration. The `differ` package will iterate through the `Change` objects and produce a single `Diff` that represents a processed summary of the changes described by diff --git a/internal/command/jsonformat/computed/doc.go b/internal/command/jsonformat/computed/doc.go index 8066682f40..d42789ab72 100644 --- a/internal/command/jsonformat/computed/doc.go +++ b/internal/command/jsonformat/computed/doc.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: MPL-2.0 // Package computed contains types that represent the computed diffs for -// Terraform blocks, attributes, and outputs. +// OpenTF blocks, attributes, and outputs. // // Each Diff struct is made up of a renderer, an action, and a boolean // describing the diff. The renderer internally holds child diffs or concrete diff --git a/internal/command/jsonformat/differ/differ_test.go b/internal/command/jsonformat/differ/differ_test.go index 3e96a9d019..15aaf3fcd0 100644 --- a/internal/command/jsonformat/differ/differ_test.go +++ b/internal/command/jsonformat/differ/differ_test.go @@ -2743,7 +2743,7 @@ func TestSpecificCases(t *testing.T) { }, nil, nil, nil, nil, plans.Create, false), }, - // The following tests are from issue 33472. Basically Terraform allows + // The following tests are from issue 33472. Basically OpenTF allows // callers to treat numbers as strings in references and expects us // to coerce the strings into numbers. For example the following are // equivalent. diff --git a/internal/command/jsonformat/differ/list.go b/internal/command/jsonformat/differ/list.go index 71578ea036..aa987f66e8 100644 --- a/internal/command/jsonformat/differ/list.go +++ b/internal/command/jsonformat/differ/list.go @@ -26,7 +26,7 @@ func computeAttributeDiffAsList(change structured.Change, elementType cty.Type) // we just treat all children of a relevant list or set as also // relevant. // - // Interestingly the terraform plan builder also agrees with this, and + // Interestingly the opentf plan builder also agrees with this, and // never sets relevant attributes beneath lists or sets. We're just // going to enforce this logic here as well. If the collection is // relevant (decided elsewhere), then every element in the collection is diff --git a/internal/command/jsonformat/differ/set.go b/internal/command/jsonformat/differ/set.go index ed81706067..6a5283a464 100644 --- a/internal/command/jsonformat/differ/set.go +++ b/internal/command/jsonformat/differ/set.go @@ -90,7 +90,7 @@ func processSet(change structured.Change, process func(value structured.Change)) // we just treat all children of a relevant list or set as also // relevant. // - // Interestingly the terraform plan builder also agrees with this, and + // Interestingly the opentf plan builder also agrees with this, and // never sets relevant attributes beneath lists or sets. We're just // going to enforce this logic here as well. If the collection is // relevant (decided elsewhere), then every element in the collection is diff --git a/internal/command/jsonformat/jsondiff/diff.go b/internal/command/jsonformat/jsondiff/diff.go index 8d0853365e..92b750376f 100644 --- a/internal/command/jsonformat/jsondiff/diff.go +++ b/internal/command/jsonformat/jsondiff/diff.go @@ -108,7 +108,7 @@ func (opts JsonOpts) processArray(change structured.ChangeSlice) computed.Diff { // we just treat all children of a relevant list as also relevant, so we // ignore the relevant attributes field. // - // Interestingly the terraform plan builder also agrees with this, and + // Interestingly the opentf plan builder also agrees with this, and // never sets relevant attributes beneath lists or sets. We're just // going to enforce this logic here as well. If the list is relevant // (decided elsewhere), then every element in the list is also relevant. diff --git a/internal/command/jsonformat/renderer.go b/internal/command/jsonformat/renderer.go index f3ff3f0969..41cc3ea95f 100644 --- a/internal/command/jsonformat/renderer.go +++ b/internal/command/jsonformat/renderer.go @@ -85,7 +85,7 @@ type Renderer struct { func (renderer Renderer) RenderHumanPlan(plan Plan, mode plans.Mode, opts ...plans.Quality) { if incompatibleVersions(jsonplan.FormatVersion, plan.PlanFormatVersion) || incompatibleVersions(jsonprovider.FormatVersion, plan.ProviderFormatVersion) { renderer.Streams.Println(format.WordWrap( - renderer.Colorize.Color("\n[bold][red]Warning:[reset][bold] This plan was generated using a different version of Terraform, the diff presented here may be missing representations of recent features."), + renderer.Colorize.Color("\n[bold][red]Warning:[reset][bold] This plan was generated using a different version of OpenTF, the diff presented here may be missing representations of recent features."), renderer.Streams.Stdout.Columns())) } @@ -95,7 +95,7 @@ func (renderer Renderer) RenderHumanPlan(plan Plan, mode plans.Mode, opts ...pla func (renderer Renderer) RenderHumanState(state State) { if incompatibleVersions(jsonstate.FormatVersion, state.StateFormatVersion) || incompatibleVersions(jsonprovider.FormatVersion, state.ProviderFormatVersion) { renderer.Streams.Println(format.WordWrap( - renderer.Colorize.Color("\n[bold][red]Warning:[reset][bold] This state was retrieved using a different version of Terraform, the state presented here maybe missing representations of recent features."), + renderer.Colorize.Color("\n[bold][red]Warning:[reset][bold] This state was retrieved using a different version of OpenTF, the state presented here maybe missing representations of recent features."), renderer.Streams.Stdout.Columns())) } diff --git a/internal/command/jsonformat/structured/attribute_path/matcher.go b/internal/command/jsonformat/structured/attribute_path/matcher.go index 409fc60e16..96391cf4fc 100644 --- a/internal/command/jsonformat/structured/attribute_path/matcher.go +++ b/internal/command/jsonformat/structured/attribute_path/matcher.go @@ -177,13 +177,13 @@ func (p *PathMatcher) GetChildWithIndex(index int) Matcher { continue } - // Terraform actually allows user to provide strings into indexes as + // OpenTF actually allows user to provide strings into indexes as // long as the string can be interpreted into a number. For example, the // following are equivalent and we need to support them. // - test_resource.resource.list[0].attribute // - test_resource.resource.list["0"].attribute // - // Note, that Terraform will raise a validation error if the string + // Note, that OpenTF will raise a validation error if the string // can't be coerced into a number, so we will panic here if anything // goes wrong safe in the knowledge the validation should stop this from // happening. @@ -196,13 +196,13 @@ func (p *PathMatcher) GetChildWithIndex(index int) Matcher { case string: f, err := strconv.ParseFloat(val, 64) if err != nil { - panic(fmt.Errorf("found invalid type within path (%v:%T), the validation shouldn't have allowed this to happen; this is a bug in Terraform, please report it", val, val)) + panic(fmt.Errorf("found invalid type within path (%v:%T), the validation shouldn't have allowed this to happen; this is a bug in OpenTF, please report it", val, val)) } if int(f) == index { child.Paths = append(child.Paths, path[1:]) } default: - panic(fmt.Errorf("found invalid type within path (%v:%T), the validation shouldn't have allowed this to happen; this is a bug in Terraform, please report it", val, val)) + panic(fmt.Errorf("found invalid type within path (%v:%T), the validation shouldn't have allowed this to happen; this is a bug in OpenTF, please report it", val, val)) } } return child