Skip to content

Commit c79cd32

Browse files
authored
Bump tflint-plugin-sdk to v0.18.0 (#1813)
1 parent 4d4c21e commit c79cd32

File tree

6 files changed

+9
-57
lines changed

6 files changed

+9
-57
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/sourcegraph/go-lsp v0.0.0-20200429204803-219e11d77f5d
2525
github.com/sourcegraph/jsonrpc2 v0.2.0
2626
github.com/spf13/afero v1.9.5
27-
github.com/terraform-linters/tflint-plugin-sdk v0.17.0
27+
github.com/terraform-linters/tflint-plugin-sdk v0.18.0
2828
github.com/terraform-linters/tflint-ruleset-terraform v0.4.0
2929
github.com/xeipuuv/gojsonschema v1.2.0
3030
github.com/zclconf/go-cty v1.13.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
462462
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
463463
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
464464
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
465-
github.com/terraform-linters/tflint-plugin-sdk v0.17.0 h1:epg9rqt6zaj7C3qaNqRMlqscOqX0S1UKiTk+UHGvi1Q=
466-
github.com/terraform-linters/tflint-plugin-sdk v0.17.0/go.mod h1:XrMaY79YpbU4J4cZgo6o4F31ZiMO2ccETXISniTOCsA=
465+
github.com/terraform-linters/tflint-plugin-sdk v0.18.0 h1:XqQS6/RfUU6J3ySDTdN5c/KvNu6sOYdGqtTo4zgRPXE=
466+
github.com/terraform-linters/tflint-plugin-sdk v0.18.0/go.mod h1:OvyC1d9NyIFxNZQeKM7vSGrRWq0cuq27zAQUMpJH5h8=
467467
github.com/terraform-linters/tflint-ruleset-terraform v0.4.0 h1:HOkKth3zhtpEo4J0f122ln6xAo1RKnroDYzP+gnZWbM=
468468
github.com/terraform-linters/tflint-ruleset-terraform v0.4.0/go.mod h1:rcgg6YCJIvU2zL2aJlYE9s1u0HirSunjJg7Gu/mqUNY=
469469
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=

plugin/discovery.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
// is specified will launch the bundled plugin instead of returning an error.
2323
func Discovery(config *tflint.Config) (*Plugin, error) {
2424
clients := map[string]*plugin.Client{}
25-
rulesets := map[string]*host2plugin.GRPCClient{}
25+
rulesets := map[string]*host2plugin.Client{}
2626

2727
for _, pluginCfg := range config.Plugins {
2828
installCfg := NewInstallConfig(config, pluginCfg)
@@ -64,7 +64,7 @@ func Discovery(config *tflint.Config) (*Plugin, error) {
6464
if err != nil {
6565
return nil, err
6666
}
67-
ruleset := raw.(*host2plugin.GRPCClient)
67+
ruleset := raw.(*host2plugin.Client)
6868

6969
clients[pluginCfg.Name] = client
7070
rulesets[pluginCfg.Name] = ruleset

plugin/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var SDKVersionConstraints = version.MustConstraints(version.NewConstraint(">= 0.
1919
// Plugin is an object handling plugins
2020
// Basically, it is a wrapper for go-plugin and provides an API to handle them collectively.
2121
type Plugin struct {
22-
RuleSets map[string]*host2plugin.GRPCClient
22+
RuleSets map[string]*host2plugin.Client
2323

2424
clients map[string]*plugin.Client
2525
}

plugin/server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ func (s *GRPCServer) GetModuleContent(bodyS *hclext.BodySchema, opts sdk.GetModu
6363
}
6464
}
6565

66-
//nolint:staticcheck
67-
if opts.IncludeNotCreated || opts.ExpandMode == sdk.ExpandModeNone {
66+
if opts.ExpandMode == sdk.ExpandModeNone {
6867
ctx = nil
6968
}
7069

plugin/server_test.go

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import (
1313
"github.com/hashicorp/hcl/v2/hclsyntax"
1414
"github.com/spf13/afero"
1515
"github.com/terraform-linters/tflint-plugin-sdk/hclext"
16-
"github.com/terraform-linters/tflint-plugin-sdk/plugin/host2plugin"
16+
"github.com/terraform-linters/tflint-plugin-sdk/plugin"
1717
"github.com/terraform-linters/tflint-plugin-sdk/terraform/lang/marks"
1818
sdk "github.com/terraform-linters/tflint-plugin-sdk/tflint"
1919
"github.com/terraform-linters/tflint/tflint"
2020
"github.com/zclconf/go-cty/cty"
2121
)
2222

23-
var SDKVersion = version.Must(version.NewVersion(host2plugin.SDKVersion))
23+
var SDKVersion = version.Must(version.NewVersion(plugin.SDKVersion))
2424

2525
func TestGetModuleContent(t *testing.T) {
2626
runner := tflint.TestRunner(t, map[string]string{"main.tf": `
@@ -121,53 +121,6 @@ resource "aws_instance" "bar" {
121121
},
122122
},
123123
},
124-
{
125-
Name: "include not created",
126-
Args: func() (*hclext.BodySchema, sdk.GetModuleContentOption) {
127-
return &hclext.BodySchema{
128-
Blocks: []hclext.BlockSchema{
129-
{
130-
Type: "resource",
131-
LabelNames: []string{"type", "name"},
132-
Body: &hclext.BodySchema{
133-
Attributes: []hclext.AttributeSchema{{Name: "instance_type"}},
134-
Blocks: []hclext.BlockSchema{{Type: "ebs_block_device"}},
135-
},
136-
},
137-
},
138-
}, sdk.GetModuleContentOption{ModuleCtx: sdk.SelfModuleCtxType, IncludeNotCreated: true, Hint: sdk.GetModuleContentHint{ResourceType: "aws_instance"}}
139-
},
140-
Want: &hclext.BodyContent{
141-
Blocks: hclext.Blocks{
142-
{
143-
Type: "resource",
144-
Labels: []string{"aws_instance", "baz"},
145-
Body: &hclext.BodyContent{
146-
Attributes: hclext.Attributes{"instance_type": &hclext.Attribute{Name: "instance_type"}},
147-
Blocks: hclext.Blocks{
148-
{
149-
Type: "ebs_block_device",
150-
Body: &hclext.BodyContent{Attributes: hclext.Attributes{}, Blocks: hclext.Blocks{}},
151-
},
152-
},
153-
},
154-
},
155-
{
156-
Type: "resource",
157-
Labels: []string{"aws_instance", "foo"},
158-
Body: &hclext.BodyContent{
159-
Attributes: hclext.Attributes{"instance_type": &hclext.Attribute{Name: "instance_type"}},
160-
Blocks: hclext.Blocks{
161-
{
162-
Type: "ebs_block_device",
163-
Body: &hclext.BodyContent{Attributes: hclext.Attributes{}, Blocks: hclext.Blocks{}},
164-
},
165-
},
166-
},
167-
},
168-
},
169-
},
170-
},
171124
{
172125
Name: "expand mode none",
173126
Args: func() (*hclext.BodySchema, sdk.GetModuleContentOption) {

0 commit comments

Comments
 (0)