Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider: Fix and enable tfproviderlint S031, S032, and S033 #12234

Merged
merged 2 commits into from
Mar 10, 2020
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
3 changes: 3 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ lint:
-S028 \
-S029 \
-S030 \
-S031 \
-S032 \
-S033 \
-S034 \
-V003 \
-V006 \
Expand Down
4 changes: 0 additions & 4 deletions aws/data_source_aws_cloudformation_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ func dataSourceAwsCloudFormationStack() *schema.Resource {
"template_body": {
Type: schema.TypeString,
Computed: true,
StateFunc: func(v interface{}) string {
template, _ := normalizeCloudFormationTemplate(v)
return template
},
},
"capabilities": {
Type: schema.TypeSet,
Expand Down
1 change: 0 additions & 1 deletion aws/data_source_aws_cloudhsm2_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func dataSourceCloudHsm2Cluster() *schema.Resource {

"cluster_certificates": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
7 changes: 0 additions & 7 deletions aws/data_source_aws_dynamodb_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package aws
import (
"bytes"
"fmt"
"strings"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/dynamodb"
Expand Down Expand Up @@ -140,16 +139,11 @@ func dataSourceAwsDynamoDbTable() *schema.Resource {
"stream_view_type": {
Type: schema.TypeString,
Computed: true,
StateFunc: func(v interface{}) string {
value := v.(string)
return strings.ToUpper(value)
},
},
"tags": tagsSchemaComputed(),
"ttl": {
Type: schema.TypeSet,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"attribute_name": {
Expand Down Expand Up @@ -192,7 +186,6 @@ func dataSourceAwsDynamoDbTable() *schema.Resource {
"point_in_time_recovery": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Expand Down
1 change: 0 additions & 1 deletion aws/data_source_aws_efs_file_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func dataSourceAwsEfsFileSystem() *schema.Resource {
"lifecycle_policy": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"transition_to_ia": {
Expand Down
2 changes: 0 additions & 2 deletions aws/data_source_aws_eks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func dataSourceAwsEksCluster() *schema.Resource {
},
"certificate_authority": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -88,7 +87,6 @@ func dataSourceAwsEksCluster() *schema.Resource {
"tags": tagsSchemaComputed(),
"vpc_config": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
1 change: 0 additions & 1 deletion aws/data_source_aws_elastic_beanstalk_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func dataSourceAwsElasticBeanstalkApplication() *schema.Resource {
"appversion_lifecycle": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"service_role": {
Expand Down
2 changes: 0 additions & 2 deletions aws/data_source_aws_elb.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func dataSourceAwsElb() *schema.Resource {
"access_logs": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"interval": {
Expand Down Expand Up @@ -80,7 +79,6 @@ func dataSourceAwsElb() *schema.Resource {
"health_check": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"healthy_threshold": {
Expand Down
6 changes: 0 additions & 6 deletions aws/data_source_aws_lambda_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource {
"dead_letter_config": {
Type: schema.TypeList,
Computed: true,
MinItems: 0,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"target_arn": {
Expand All @@ -49,7 +47,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource {
"layers": {
Type: schema.TypeList,
Computed: true,
MaxItems: 5,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down Expand Up @@ -81,7 +78,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource {
"vpc_config": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"subnet_ids": {
Expand Down Expand Up @@ -130,7 +126,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource {
"environment": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"variables": {
Expand All @@ -143,7 +138,6 @@ func dataSourceAwsLambdaFunction() *schema.Resource {
},
"tracing_config": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
1 change: 0 additions & 1 deletion aws/data_source_aws_lambda_layer_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func dataSourceAwsLambdaLayerVersion() *schema.Resource {
"compatible_runtimes": {
Type: schema.TypeSet,
Computed: true,
MaxItems: 5,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down
1 change: 0 additions & 1 deletion aws/data_source_aws_lb.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func dataSourceAwsLb() *schema.Resource {
"access_logs": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"bucket": {
Expand Down
2 changes: 0 additions & 2 deletions aws/data_source_aws_lb_target_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func dataSourceAwsLbTargetGroup() *schema.Resource {
"stickiness": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Expand All @@ -95,7 +94,6 @@ func dataSourceAwsLbTargetGroup() *schema.Resource {
"health_check": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Expand Down
2 changes: 0 additions & 2 deletions aws/data_source_aws_mq_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func dataSourceAwsMqBroker() *schema.Resource {
"configuration": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Expand Down Expand Up @@ -130,7 +129,6 @@ func dataSourceAwsMqBroker() *schema.Resource {
},
"maintenance_window_start_time": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
7 changes: 0 additions & 7 deletions aws/data_source_aws_rds_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package aws
import (
"fmt"
"log"
"strings"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/rds"
Expand Down Expand Up @@ -120,12 +119,6 @@ func dataSourceAwsRdsCluster() *schema.Resource {
"preferred_maintenance_window": {
Type: schema.TypeString,
Computed: true,
StateFunc: func(val interface{}) string {
if val == nil {
return ""
}
return strings.ToLower(val.(string))
},
},

"port": {
Expand Down
1 change: 0 additions & 1 deletion aws/resource_aws_api_gateway_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func resourceAwsApiGatewayAccount() *schema.Resource {
"throttle_settings": {
Type: schema.TypeList,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"burst_limit": {
Expand Down
1 change: 0 additions & 1 deletion aws/resource_aws_cloudhsm2_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func resourceAwsCloudHsm2Cluster() *schema.Resource {

"cluster_certificates": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
1 change: 0 additions & 1 deletion aws/resource_aws_eks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func resourceAwsEksCluster() *schema.Resource {
},
"certificate_authority": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down