Skip to content

Commit a49af42

Browse files
lint
1 parent af8ea9f commit a49af42

File tree

8 files changed

+14
-10
lines changed

8 files changed

+14
-10
lines changed

pkg/pf/internal/schemashim/datasource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ package schemashim
1717
import (
1818
"context"
1919

20+
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
21+
2022
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/internal/internalinter"
2123
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/internal/runtypes"
2224
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
2325
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/valueshim"
24-
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
2526
)
2627

2728
type schemaOnlyDataSource struct {

pkg/pf/internal/schemashim/resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ package schemashim
1717
import (
1818
"context"
1919

20+
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
21+
2022
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/internal/internalinter"
2123
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/internal/runtypes"
2224
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
2325
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/valueshim"
24-
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
2526
)
2627

2728
type schemaOnlyResource struct {

pkg/pf/proto/schema.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
package proto
1616

1717
import (
18-
// "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
19-
2018
"github.com/hashicorp/terraform-plugin-go/tftypes"
19+
2120
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
2221
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/valueshim"
2322
)

pkg/pf/tests/upgrade_state_cross_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ func TestPFUpgrade_Downgrading(t *testing.T) {
10961096
func TestPFUpgrade_DynamicPseudoType(t *testing.T) {
10971097
t.Parallel()
10981098
ct.SkipUnlessLinux(t)
1099-
//skipUnlessDeltasEnabled(t)
1099+
// skipUnlessDeltasEnabled(t)
11001100

11011101
resourceBefore := pb.NewResource(pb.NewResourceArgs{
11021102
ResourceSchema: rschema.Schema{
@@ -1135,7 +1135,7 @@ func TestPFUpgrade_DynamicPseudoType(t *testing.T) {
11351135
InputsMap1: pmBefore,
11361136
Inputs2: tfInputsAfter,
11371137
InputsMap2: pmAfter,
1138-
//ExpectedRawStateType: resourceBeforeAndAfter.ResourceSchema.Type().TerraformType(context.Background()),
1138+
// ExpectedRawStateType: resourceBeforeAndAfter.ResourceSchema.Type().TerraformType(context.Background()),
11391139
SkipPulumi: "TODO",
11401140
}
11411141

pkg/pf/tfbridge/resource_state.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ func (p *provider) parseAndUpgradeResourceState(
256256
return nil, fmt.Errorf("[pf/tfbridge] Error calling EncodePropertyMap: %w", err)
257257
}
258258

259-
260259
// Before EnableRawStateDelta rollout, the behavior used to be to skip the upgrade method in case of an exact
261260
// version match. This seems incorrect, but to derisk fixing this problem it is flagged together with
262261
// EnableRawStateDelta so it participates in the phased rollout. Remove once rollout completes.

pkg/tfshim/walk/walk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func LookupSchemaMapPath(path SchemaPath, schemaMap shim.SchemaMap) (shim.Schema
179179
func LookupType(path SchemaPath, ty valueshim.Type) (valueshim.Type, error) {
180180
current := ty
181181
for i, step := range path {
182-
var subPath SchemaPath = path[0:i]
182+
subPath := path[0:i]
183183
switch step := step.(type) {
184184
case GetAttrStep:
185185
attr, ok := current.AttributeType(step.Name)

pkg/valueshim/cty_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ func Test_HCty_ToX(t *testing.T) {
316316
}
317317

318318
func Test_HCtyType_AttributeType(t *testing.T) {
319+
t.Parallel()
319320
objTy := cty.Object(map[string]cty.Type{"x": cty.String})
320321

321322
ty, ok := valueshim.FromHCtyType(objTy).AttributeType("x")
@@ -327,6 +328,7 @@ func Test_HCtyType_AttributeType(t *testing.T) {
327328
}
328329

329330
func Test_HCtyType_ElementType(t *testing.T) {
331+
t.Parallel()
330332
ty, ok := valueshim.FromHCtyType(cty.Set(cty.Number)).ElementType()
331333
assert.True(t, ok)
332334
assert.Equal(t, valueshim.FromHCtyType(cty.Number), ty)
@@ -339,6 +341,6 @@ func Test_HCtyType_ElementType(t *testing.T) {
339341
assert.True(t, ok)
340342
assert.Equal(t, valueshim.FromHCtyType(cty.Number), ty)
341343

342-
ty, ok = valueshim.FromHCtyType(cty.String).ElementType()
344+
_, ok = valueshim.FromHCtyType(cty.String).ElementType()
343345
assert.False(t, ok)
344346
}

pkg/valueshim/tfvalue_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ func Test_TType(t *testing.T) {
314314
}
315315

316316
func Test_TType_AttributeType(t *testing.T) {
317+
t.Parallel()
317318
objTy := tftypes.Object{AttributeTypes: map[string]tftypes.Type{"x": tftypes.String}}
318319

319320
ty, ok := valueshim.FromTType(objTy).AttributeType("x")
@@ -325,6 +326,7 @@ func Test_TType_AttributeType(t *testing.T) {
325326
}
326327

327328
func Test_TType_ElementType(t *testing.T) {
329+
t.Parallel()
328330
ty, ok := valueshim.FromTType(tftypes.Set{ElementType: tftypes.Number}).ElementType()
329331
assert.True(t, ok)
330332
assert.Equal(t, valueshim.FromTType(tftypes.Number), ty)
@@ -337,7 +339,7 @@ func Test_TType_ElementType(t *testing.T) {
337339
assert.True(t, ok)
338340
assert.Equal(t, valueshim.FromTType(tftypes.Number), ty)
339341

340-
ty, ok = valueshim.FromTType(tftypes.String).ElementType()
342+
_, ok = valueshim.FromTType(tftypes.String).ElementType()
341343
assert.False(t, ok)
342344
}
343345

0 commit comments

Comments
 (0)