Skip to content

Commit a39e4aa

Browse files
deps: update dependency golangci/golangci-lint to v1.56.2 (#868)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [golangci/golangci-lint](https://togithub.com/golangci/golangci-lint) | | patch | `v1.56.0` -> `v1.56.2` | | [golangci/golangci-lint](https://togithub.com/ldez/golangci-lint) | image | patch | `v1.56.0` -> `v1.56.2` | --- ### Release Notes <details> <summary>golangci/golangci-lint (golangci/golangci-lint)</summary> ### [`v1.56.2`](https://togithub.com/golangci/golangci-lint/compare/v1.56.1...v1.56.2) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.1...v1.56.2) ### [`v1.56.1`](https://togithub.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1561) [Compare Source](https://togithub.com/golangci/golangci-lint/compare/v1.56.0...v1.56.1) 1. updated linters - `errcheck`: from 1.6.3 to 1.7.0 - `govet`: disable `loopclosure` with go1.22 - `revive`: from 1.3.6 to 1.3.7 - `testifylint`: from 1.1.0 to 1.1.1 </details> <details> <summary>ldez/golangci-lint (golangci/golangci-lint)</summary> ### [`v1.56.2`](https://togithub.com/ldez/golangci-lint/blob/HEAD/CHANGELOG.md#v1562) 1. updated linters - `go-critic`: from 0.11.0 to 0.11.1 - `gosec`: from 2.18.2 to 2.19.0 - `testifylint`: from 1.1.1 to 1.1.2 - `usestdlibvars`: from 1.24.0 to 1.25.0 - `wsl`: from 4.2.0 to 4.2.1 2. misc. - Fix missing version in Docker image 3. Documentation - Explain the limitation of new-from-rev and new-from-patch ### [`v1.56.1`](https://togithub.com/ldez/golangci-lint/blob/HEAD/CHANGELOG.md#v1561) 1. updated linters - `errcheck`: from 1.6.3 to 1.7.0 - `govet`: disable `loopclosure` with go1.22 - `revive`: from 1.3.6 to 1.3.7 - `testifylint`: from 1.1.0 to 1.1.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/hetznercloud/terraform-provider-hcloud). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo <ljonas@riseup.net>
1 parent ac4bdf8 commit a39e4aa

23 files changed

Lines changed: 44 additions & 44 deletions

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: golangci/golangci-lint-action@v4
1919
with:
20-
version: v1.56.0 # renovate: datasource=github-releases depName=golangci/golangci-lint
20+
version: v1.56.2 # renovate: datasource=github-releases depName=golangci/golangci-lint
2121

2222
# In general linting is quite fast with warm caches, but a fresh run might
2323
# take some time.

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test:acceptance:
1616

1717
test:golangci-lint:
1818
stage: test
19-
image: golangci/golangci-lint:v1.56.0
19+
image: golangci/golangci-lint:v1.56.2
2020
script:
2121
- golangci-lint run -v
2222
except:

hcloud/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func Provider() *schema.Provider {
4747
Optional: true,
4848
DefaultFunc: schema.EnvDefaultFunc("HCLOUD_TOKEN", nil),
4949
Description: "The Hetzner Cloud API token, can also be specified with the HCLOUD_TOKEN environment variable.",
50-
ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) {
50+
ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { // nolint:revive
5151
token := val.(string)
5252
if len(token) != 64 {
5353
errs = append(errs, errors.New("entered token is invalid (must be exactly 64 characters long)"))

internal/certificate/resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func UploadedResource() *schema.Resource {
6969
Type: schema.TypeString,
7070
Required: true,
7171
ForceNew: true,
72-
DiffSuppressFunc: func(_, certOld, certNew string, d *schema.ResourceData) bool {
72+
DiffSuppressFunc: func(_, certOld, certNew string, d *schema.ResourceData) bool { // nolint:revive
7373
res, err := EqualCert(certOld, certNew)
7474
if err != nil {
7575
log.Printf("[ERROR] compare certificates for equality: %v", err)
@@ -82,7 +82,7 @@ func UploadedResource() *schema.Resource {
8282
Type: schema.TypeMap,
8383
Optional: true,
8484
Elem: schema.TypeString,
85-
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics {
85+
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics { // nolint:revive
8686
if ok, err := hcloud.ValidateResourceLabels(i.(map[string]interface{})); !ok {
8787
return diag.Errorf(err.Error())
8888
}

internal/datacenter/data_source.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ type resourceData struct {
3434
Name types.String `tfsdk:"name"`
3535
Description types.String `tfsdk:"description"`
3636
Location types.Map `tfsdk:"location"`
37-
SupportedServerTypeIds types.List `tfsdk:"supported_server_type_ids"`
38-
AvailableServerTypeIds types.List `tfsdk:"available_server_type_ids"`
37+
SupportedServerTypeIDs types.List `tfsdk:"supported_server_type_ids"`
38+
AvailableServerTypeIDs types.List `tfsdk:"available_server_type_ids"`
3939
}
4040

4141
var resourceDataAttrTypes = map[string]attr.Type{
@@ -67,20 +67,20 @@ func newResourceData(ctx context.Context, in *hcloud.Datacenter) (resourceData,
6767
})
6868
diags.Append(newDiags...)
6969

70-
supportedServerTypeIds := make([]int64, len(in.ServerTypes.Supported))
70+
supportedServerTypeIDs := make([]int64, len(in.ServerTypes.Supported))
7171
for i, v := range in.ServerTypes.Supported {
72-
supportedServerTypeIds[i] = int64(v.ID)
72+
supportedServerTypeIDs[i] = int64(v.ID)
7373
}
74-
availableServerTypeIds := make([]int64, len(in.ServerTypes.Available))
74+
availableServerTypeIDs := make([]int64, len(in.ServerTypes.Available))
7575
for i, v := range in.ServerTypes.Available {
76-
availableServerTypeIds[i] = int64(v.ID)
76+
availableServerTypeIDs[i] = int64(v.ID)
7777
}
78-
sort.Slice(supportedServerTypeIds, func(i, j int) bool { return supportedServerTypeIds[i] < supportedServerTypeIds[j] })
79-
sort.Slice(availableServerTypeIds, func(i, j int) bool { return availableServerTypeIds[i] < availableServerTypeIds[j] })
78+
sort.Slice(supportedServerTypeIDs, func(i, j int) bool { return supportedServerTypeIDs[i] < supportedServerTypeIDs[j] })
79+
sort.Slice(availableServerTypeIDs, func(i, j int) bool { return availableServerTypeIDs[i] < availableServerTypeIDs[j] })
8080

81-
data.SupportedServerTypeIds, newDiags = types.ListValueFrom(ctx, types.Int64Type, supportedServerTypeIds)
81+
data.SupportedServerTypeIDs, newDiags = types.ListValueFrom(ctx, types.Int64Type, supportedServerTypeIDs)
8282
diags.Append(newDiags...)
83-
data.AvailableServerTypeIds, newDiags = types.ListValueFrom(ctx, types.Int64Type, availableServerTypeIds)
83+
data.AvailableServerTypeIDs, newDiags = types.ListValueFrom(ctx, types.Int64Type, availableServerTypeIDs)
8484
diags.Append(newDiags...)
8585

8686
return data, diags

internal/firewall/resource.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func Resource() *schema.Resource {
3939
Type: schema.TypeMap,
4040
Optional: true,
4141
Computed: true,
42-
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics {
42+
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics { // nolint:revive
4343
if ok, err := hcloud.ValidateResourceLabels(i.(map[string]interface{})); !ok {
4444
return diag.Errorf(err.Error())
4545
}
@@ -79,7 +79,7 @@ func Resource() *schema.Resource {
7979
"direction": {
8080
Type: schema.TypeString,
8181
Required: true,
82-
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics {
82+
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics { // nolint:revive
8383
direction := i.(string)
8484
switch hcloud.FirewallRuleDirection(direction) {
8585
case hcloud.FirewallRuleDirectionIn:
@@ -93,7 +93,7 @@ func Resource() *schema.Resource {
9393
"protocol": {
9494
Type: schema.TypeString,
9595
Required: true,
96-
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics {
96+
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics { // nolint:revive
9797
protocol := i.(string)
9898
switch hcloud.FirewallRuleProtocol(protocol) {
9999
case hcloud.FirewallRuleProtocolICMP:

internal/floatingip/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Resource() *schema.Resource {
6363
"labels": {
6464
Type: schema.TypeMap,
6565
Optional: true,
66-
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics {
66+
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics { // nolint:revive
6767
if ok, err := hcloud.ValidateResourceLabels(i.(map[string]interface{})); !ok {
6868
return diag.Errorf(err.Error())
6969
}

internal/floatingip/resource_assignment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func TestFloatingIPAssignmentResource_Basic(t *testing.T) {
8787
ResourceName: res.TFID(),
8888
ImportState: true,
8989
ImportStateVerify: true,
90-
ImportStateIdFunc: func(state *terraform.State) (string, error) {
90+
ImportStateIdFunc: func(_ *terraform.State) (string, error) {
9191
return fmt.Sprintf("%d", f.ID), nil
9292
},
9393
},

internal/loadbalancer/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func Resource() *schema.Resource {
8888
Type: schema.TypeMap,
8989
Optional: true,
9090
Computed: true,
91-
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics {
91+
ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics { // nolint:revive
9292
if ok, err := hcloud.ValidateResourceLabels(i.(map[string]interface{})); !ok {
9393
return diag.Errorf(err.Error())
9494
}

internal/loadbalancer/resource_network_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func TestAccHcloudLoadBalancerNetwork_NetworkID(t *testing.T) {
7676
ResourceName: loadbalancer.NetworkResourceType + ".test-network",
7777
ImportState: true,
7878
ImportStateVerify: true,
79-
ImportStateIdFunc: func(state *terraform.State) (string, error) {
79+
ImportStateIdFunc: func(_ *terraform.State) (string, error) {
8080
return fmt.Sprintf("%d-%d", lb.ID, nw.ID), nil
8181
},
8282
},

0 commit comments

Comments
 (0)