Skip to content

Commit c0600cc

Browse files
authored
Merge pull request #120 from planetscale/joem/gha-golangci-lint-action-v7
chore(ci): bump golangci-lint to v2
2 parents 380eb77 + 9534b77 commit c0600cc

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

.github/workflows/test-extensive.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ jobs:
4545
go-version-file: 'go.mod'
4646
- run: make build
4747
- name: Run linters
48-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6
49-
with:
50-
version: latest
48+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7
5149

5250
test-terraform:
5351
name: integration-terraform

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ jobs:
2929
go-version-file: 'go.mod'
3030
- run: go build -v .
3131
- name: Run linters
32-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6
33-
with:
34-
version: latest
32+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7
3533

3634
generate:
3735
name: generate diff test

.golangci.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
1-
# Visit https://golangci-lint.run/ for usage documentation
2-
# and information on other useful linters
3-
issues:
4-
max-same-issues: 0
5-
1+
version: "2"
62
linters:
7-
disable-all: true
3+
default: none
84
enable:
95
- durationcheck
106
- errcheck
11-
# TODO: enable copyloopvar
12-
#- copyloopvar
137
- forcetypeassert
148
- godot
15-
- gofmt
16-
- gosimple
9+
- govet
1710
- ineffassign
1811
- makezero
1912
- misspell
2013
- nilerr
2114
- predeclared
2215
- staticcheck
23-
- usetesting
2416
- unconvert
2517
- unparam
2618
- unused
27-
- govet
19+
- usetesting
20+
exclusions:
21+
generated: lax
22+
presets:
23+
- comments
24+
- common-false-positives
25+
- legacy
26+
- std-error-handling
27+
paths:
28+
- third_party$
29+
- builtin$
30+
- examples$
31+
settings:
32+
staticcheck:
33+
checks:
34+
- all
35+
# disable these:
36+
- -QF1008
37+
- -ST1003
38+
39+
issues:
40+
max-same-issues: 0
41+
formatters:
42+
enable:
43+
- gofmt
44+
exclusions:
45+
generated: lax
46+
paths:
47+
- third_party$
48+
- builtin$
49+
- examples$

internal/provider/branch_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func (r *branchResource) Create(ctx context.Context, req resource.CreateRequest,
260260
Name: name.ValueString(),
261261
ParentBranch: *parentBranch,
262262
}
263-
if !(data.RestoredFromBranch.IsNull() || data.RestoredFromBranch.IsUnknown()) {
263+
if !data.RestoredFromBranch.IsNull() && !data.RestoredFromBranch.IsUnknown() {
264264
var rfb restoredFromBranchResource
265265
resp.Diagnostics.Append(data.RestoredFromBranch.As(ctx, &rfb, basetypes.ObjectAsOptions{})...)
266266
if resp.Diagnostics.HasError() {

0 commit comments

Comments
 (0)