Skip to content

Commit e57f353

Browse files
authored
[MAINT] Upgrade golangci-lint v2.10 & go to 1.26 (#3244)
* Remove `misspell` We don't use it and that version is deprecated Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Stop linter failing if there are other linter processes running Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Upgrade golangci-lint to v2.10.1 Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Fix linter warnings Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Remove mentions of `website-lint` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Remove unnecessary `make lintcheck` in `ci.yaml` Since `make build` calls `make lintcheck` Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Upgrade to go 1.25 Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update `go` to v1.26 Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Run `go fix` and remove unused funcs Signed-off-by: Timo Sand <timo.sand@f-secure.com> * Update Terraform version requirement in README * Update Terraform version requirement in README --------- Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 1af72d4 commit e57f353

File tree

57 files changed

+312
-324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+312
-324
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@ jobs:
3434
go-version-file: go.mod
3535
cache: true
3636
- run: make tools
37-
- run: make lintcheck
38-
- run: make website-lint
3937
- run: make build
4038
- run: make test

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
version: "2"
22

3+
run:
4+
allow-serial-runners: true
5+
36
linters:
47
default: none
58

GNUmakefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ endif
2828
default: build
2929

3030
tools:
31-
go install github.com/client9/misspell/cmd/misspell@v0.3.4
32-
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.0
31+
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1
3332

3433
build: lintcheck
3534
CGO_ENABLED=0 go build -ldflags="-s -w" ./...
@@ -73,15 +72,11 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
7372
endif
7473
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
7574

76-
website-lint:
77-
@echo "==> Checking website against linters..."
78-
@misspell -error -source=text website/
79-
8075
website-test:
8176
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
8277
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
8378
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
8479
endif
8580
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
8681

87-
.PHONY: build test testacc fmt lint lintcheck tools website website-lint website-test sweep
82+
.PHONY: build test testacc fmt lint lintcheck tools website website-test sweep

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Terraform Provider GitHub
1+
# Terraform Provider GitHub
22
=========================
33

44
<img src="https://cloud.githubusercontent.com/assets/98681/24211275/c4ebd04e-0ee8-11e7-8606-061d656a42df.png" width="72" height="">
@@ -9,8 +9,8 @@ This project is used to manipulate GitHub resources (repositories, teams, files,
99

1010
## Requirements
1111

12-
- [Terraform](https://www.terraform.io/downloads.html) 0.10.x
13-
- [Go](https://golang.org/doc/install) 1.24.x (to build the provider plugin)
12+
- [Terraform](https://www.terraform.io/downloads.html) 1.x
13+
- [Go](https://golang.org/doc/install) 1.26.x (to build the provider plugin)
1414

1515
## Usage
1616

github/data_source_github_branch_protection_rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func dataSourceGithubBranchProtectionRulesRead(ctx context.Context, d *schema.Re
7474
if !query.Repository.BranchProtectionRules.PageInfo.HasNextPage {
7575
break
7676
}
77-
variables["cursor"] = githubv4.NewString(query.Repository.BranchProtectionRules.PageInfo.EndCursor)
77+
variables["cursor"] = new(query.Repository.BranchProtectionRules.PageInfo.EndCursor)
7878
}
7979

8080
d.SetId(string(query.Repository.ID))

github/data_source_github_organization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func dataSourceGithubOrganizationRead(ctx context.Context, d *schema.ResourceDat
241241
if !query.Organization.MembersWithRole.PageInfo.HasNextPage {
242242
break
243243
}
244-
variables["after"] = githubv4.NewString(query.Organization.MembersWithRole.PageInfo.EndCursor)
244+
variables["after"] = new(query.Organization.MembersWithRole.PageInfo.EndCursor)
245245
}
246246

247247
_ = d.Set("repositories", repoList)

github/data_source_github_organization_external_identities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func dataSourceGithubOrganizationExternalIdentitiesRead(ctx context.Context, d *
121121
if !query.Organization.SamlIdentityProvider.PageInfo.HasNextPage {
122122
break
123123
}
124-
variables["after"] = githubv4.NewString(query.Organization.SamlIdentityProvider.PageInfo.EndCursor)
124+
variables["after"] = new(query.Organization.SamlIdentityProvider.PageInfo.EndCursor)
125125
}
126126

127127
d.SetId(name)

github/data_source_github_organization_ip_allow_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func dataSourceGithubOrganizationIpAllowListRead(ctx context.Context, d *schema.
9898
if !query.Organization.IpAllowListEntries.PageInfo.HasNextPage {
9999
break
100100
}
101-
variables["entriesCursor"] = githubv4.NewString(query.Organization.IpAllowListEntries.PageInfo.EndCursor)
101+
variables["entriesCursor"] = new(query.Organization.IpAllowListEntries.PageInfo.EndCursor)
102102
}
103103
for index := range ipAllowListEntries {
104104
ipAllowList = append(ipAllowList, map[string]any{

github/data_source_github_organization_teams.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func dataSourceGithubOrganizationTeamsRead(ctx context.Context, d *schema.Resour
131131
if !query.Organization.Teams.PageInfo.HasNextPage {
132132
break
133133
}
134-
variables["cursor"] = githubv4.NewString(query.Organization.Teams.PageInfo.EndCursor)
134+
variables["cursor"] = new(query.Organization.Teams.PageInfo.EndCursor)
135135
}
136136

137137
d.SetId(string(query.Organization.ID))

github/resource_github_actions_organization_permissions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func resourceGithubActionsOrganizationPermissionsCreateOrUpdate(d *schema.Resour
159159
}
160160

161161
if v, ok := d.GetOk("sha_pinning_required"); ok {
162-
actionsPermissions.SHAPinningRequired = github.Ptr(v.(bool))
162+
actionsPermissions.SHAPinningRequired = new(v.(bool))
163163
}
164164

165165
_, _, err = client.Actions.UpdateActionsPermissions(ctx,
@@ -313,8 +313,8 @@ func resourceGithubActionsOrganizationPermissionsDelete(d *schema.ResourceData,
313313
_, _, err = client.Actions.UpdateActionsPermissions(ctx,
314314
orgName,
315315
github.ActionsPermissions{
316-
AllowedActions: github.Ptr("all"),
317-
EnabledRepositories: github.Ptr("all"),
316+
AllowedActions: new("all"),
317+
EnabledRepositories: new("all"),
318318
})
319319
if err != nil {
320320
return err

0 commit comments

Comments
 (0)