Skip to content

Commit

Permalink
Mirror diagnostic types terraform -json outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
appilon committed Dec 7, 2020
1 parent 92a0f3f commit e609a8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tfexec/internal/e2etest/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestValidate(t *testing.T) {
Severity: "error",
Summary: "Unsupported block type",
Detail: "Blocks of type \"bad_block\" are not expected here.",
Range: tfexec.Range{
Range: &tfexec.Range{
Filename: "main.tf",
Start: tfexec.Pos{
Line: 1,
Expand All @@ -88,7 +88,7 @@ func TestValidate(t *testing.T) {
Severity: "error",
Summary: "Unsupported argument",
Detail: "An argument named \"bad_attribute\" is not expected here.",
Range: tfexec.Range{
Range: &tfexec.Range{
Filename: "main.tf",
Start: tfexec.Pos{
Line: 5,
Expand Down
8 changes: 4 additions & 4 deletions tfexec/validate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ type Validation struct {
}

type Diagnostic struct {
Severity string `json:"severity"`
Summary string `json:"summary"`
Detail string `json:"detail"`
Range Range `json:"range"`
Severity string `json:"severity,omitempty"`
Summary string `json:"summary,omitempty"`
Detail string `json:"detail,omitempty"`
Range *Range `json:"range,omitempty"`
}

type Range struct {
Expand Down

0 comments on commit e609a8f

Please sign in to comment.