Skip to content

Commit

Permalink
Added nolint for Threshold of anomaly_subscription (#30419)
Browse files Browse the repository at this point in the history
* Added nolint for Threshold

* nolint Threshold

* chore(ci): rm ce staticcheck exception

* r/aws_ce_anomaly_subscription: specify linter in nolint

---------

Co-authored-by: Marek Schwarz <marek.schwarz.ext@devk.de>
Co-authored-by: Jared Baker <jared.baker@hashicorp.com>
  • Loading branch information
3 people authored Apr 14, 2023
1 parent 916f5ca commit e60ab1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .ci/.golangci2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ issues:
- staticcheck
path: internal/service/batch/
text: "SA1019: apiObject.ImageId is deprecated: This field is deprecated"
- linters:
- staticcheck
path: internal/service/ce/
text: "SA1019: [a-zA-Z0-9.]+.\\w+ is deprecated: \\w+ has been deprecated"
- linters:
- staticcheck
path: "internal/service/cloudfront"
Expand Down
6 changes: 3 additions & 3 deletions internal/service/ce/anomaly_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func resourceAnomalySubscriptionCreate(ctx context.Context, d *schema.ResourceDa
}

if v, ok := d.GetOk("threshold"); ok {
input.AnomalySubscription.Threshold = aws.Float64(v.(float64))
input.AnomalySubscription.Threshold = aws.Float64(v.(float64)) //nolint:staticcheck // see https://github.com/hashicorp/terraform-provider-aws/issues/30326
}

if v, ok := d.GetOk("threshold_expression"); ok {
Expand Down Expand Up @@ -160,7 +160,7 @@ func resourceAnomalySubscriptionRead(ctx context.Context, d *schema.ResourceData
d.Set("frequency", subscription.Frequency)
d.Set("monitor_arn_list", subscription.MonitorArnList)
d.Set("subscriber", flattenAnomalySubscriptionSubscribers(subscription.Subscribers))
d.Set("threshold", subscription.Threshold)
d.Set("threshold", subscription.Threshold) //nolint:staticcheck // see https://github.com/hashicorp/terraform-provider-aws/issues/30326
d.Set("name", subscription.SubscriptionName)

if err = d.Set("threshold_expression", []interface{}{flattenCostCategoryRuleExpression(subscription.ThresholdExpression)}); err != nil {
Expand Down Expand Up @@ -191,7 +191,7 @@ func resourceAnomalySubscriptionUpdate(ctx context.Context, d *schema.ResourceDa
}

if d.HasChange("threshold") {
input.Threshold = aws.Float64(d.Get("threshold").(float64))
input.Threshold = aws.Float64(d.Get("threshold").(float64)) //nolint:staticcheck // see https://github.com/hashicorp/terraform-provider-aws/issues/30326
}

if d.HasChange("threshold_expression") {
Expand Down

0 comments on commit e60ab1a

Please sign in to comment.