Skip to content

Commit 7fc238c

Browse files
fix: Upgrade golangci-lint to v2 (#2228)
This PR upgrades golangci-lint and it's corresponding configuration file to v2 format since development environment versions have already received the updates.
1 parent dec7897 commit 7fc238c

File tree

5 files changed

+91
-79
lines changed

5 files changed

+91
-79
lines changed

.github/workflows/lint_golang.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
with:
1919
go-version-file: go.mod
2020
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v8
2222
with:
23-
version: v1.64.8
23+
version: v2.2.1

.golangci.yml

Lines changed: 86 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,103 @@
1+
version: "2"
12
run:
23
tests: true
3-
timeout: 10m
4-
5-
linters-settings:
6-
errcheck:
7-
check-blank: false
8-
gocritic:
9-
disabled-checks:
10-
- commentFormatting
11-
dupl:
12-
# tokens count to trigger issue, 150 by default
13-
threshold: 500
14-
decorder:
15-
dec-order:
16-
- type
17-
- const
18-
- var
19-
- func
20-
disable-dec-order-check: false
21-
govet:
22-
enable-all: true
23-
disable:
24-
- fieldalignment
25-
- shadow
26-
27-
revive:
28-
enable-all-rules: true
29-
rules:
30-
- name: cyclomatic
31-
disabled: true
32-
- name: argument-limit
33-
disabled: true
34-
- name: function-length
35-
disabled: true
36-
- name: function-result-limit
37-
disabled: true
38-
- name: line-length-limit
39-
disabled: true
40-
- name: file-header
41-
disabled: true
42-
- name: cognitive-complexity
43-
disabled: true
44-
- name: banned-characters
45-
disabled: true
46-
- name: max-public-structs
47-
disabled: true
48-
- name: add-constant
49-
disabled: true
50-
- name: unhandled-error
51-
disabled: true
52-
- name: deep-exit
53-
disabled: true
54-
- name: nested-structs
55-
disabled: true
56-
- name: import-alias-naming
57-
disabled: true
58-
- name: unchecked-type-assertion
59-
disabled: true
60-
61-
gofmt:
62-
rewrite-rules:
63-
- pattern: 'interface{}'
64-
replacement: 'any'
65-
- pattern: 'a[b:len(a)]'
66-
replacement: 'a[b:]'
67-
68-
694
linters:
705
enable:
716
- asciicheck
727
- bodyclose
738
- dupl
74-
- errcheck
759
- gocritic
76-
- gofmt
77-
- gosimple
78-
- govet
79-
- ineffassign
8010
- importas
8111
- misspell
8212
- nakedret
8313
- prealloc
8414
- revive
85-
- staticcheck
8615
- unconvert
8716
- unparam
88-
- unused
17+
settings:
18+
decorder:
19+
dec-order:
20+
- type
21+
- const
22+
- var
23+
- func
24+
disable-dec-order-check: false
25+
dupl:
26+
threshold: 500
27+
errcheck:
28+
check-blank: false
29+
gocritic:
30+
disabled-checks:
31+
- commentFormatting
32+
govet:
33+
disable:
34+
- fieldalignment
35+
- shadow
36+
enable-all: true
37+
revive:
38+
enable-all-rules: true
39+
rules:
40+
- name: cyclomatic
41+
disabled: true
42+
- name: argument-limit
43+
disabled: true
44+
- name: function-length
45+
disabled: true
46+
- name: function-result-limit
47+
disabled: true
48+
- name: line-length-limit
49+
disabled: true
50+
- name: file-header
51+
disabled: true
52+
- name: cognitive-complexity
53+
disabled: true
54+
- name: banned-characters
55+
disabled: true
56+
- name: max-public-structs
57+
disabled: true
58+
- name: add-constant
59+
disabled: true
60+
- name: unhandled-error
61+
disabled: true
62+
- name: deep-exit
63+
disabled: true
64+
- name: nested-structs
65+
disabled: true
66+
- name: import-alias-naming
67+
disabled: true
68+
- name: unchecked-type-assertion
69+
disabled: true
70+
- name: unnecessary-format
71+
disabled: true
72+
- name: var-naming
73+
disabled: true
74+
exclusions:
75+
generated: lax
76+
presets:
77+
- comments
78+
- common-false-positives
79+
- legacy
80+
- std-error-handling
81+
paths:
82+
- third_party$
83+
- builtin$
84+
- examples$
8985
issues:
9086
max-issues-per-linter: 0
91-
max-same-issues: 0
87+
max-same-issues: 0
88+
formatters:
89+
enable:
90+
- gofmt
91+
settings:
92+
gofmt:
93+
rewrite-rules:
94+
- pattern: interface{}
95+
replacement: any
96+
- pattern: a[b:len(a)]
97+
replacement: a[b:]
98+
exclusions:
99+
generated: lax
100+
paths:
101+
- third_party$
102+
- builtin$
103+
- examples$

scalar/duration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (s *Duration) DataType() arrow.DataType {
1717
}
1818

1919
func (s *Duration) String() string {
20-
if !s.Int.IsValid() {
20+
if !s.IsValid() {
2121
return nullValueStr
2222
}
2323

schema/testdata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func (tg TestDataGenerator) getExampleJSON(colName string, dataType arrow.DataTy
294294
if arrow.TypeEqual(dataType, types.ExtensionTypes.UUID) {
295295
// This will make UUIDs deterministic like all other types
296296
hash := sha256.New()
297-
hash.Write([]byte(fmt.Sprintf(`"AString%d"`, rnd.Intn(100000))))
297+
fmt.Fprintf(hash, `"AString%d"`, rnd.Intn(100000))
298298
u := newUUID(uuid.UUID{}, hash.Sum(nil))
299299
return `"` + u.String() + `"`
300300
}

serve/package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (s *PluginServe) writeTablesJSON(ctx context.Context, dir string) error {
8484
// PrimaryKey Will be set to true Under the following conditions:
8585
// 1. If the column is a `PrimaryKeyComponent`
8686
// 2. If the column is a `PrimaryKey` and both of the following are true column name is NOT `_cq_id` and there are other columns that are a PrimaryKeyComponent
87-
PrimaryKey: (column.PrimaryKey && !(column.Name == schema.CqIDColumn.Name && len(table.PrimaryKeyComponents()) > 0)) || column.PrimaryKeyComponent,
87+
PrimaryKey: (column.PrimaryKey && !(column.Name == schema.CqIDColumn.Name && len(table.PrimaryKeyComponents()) > 0)) || column.PrimaryKeyComponent, //nolint:staticcheck
8888
Unique: column.Unique,
8989
}
9090
if column.TypeSchema != "" {

0 commit comments

Comments
 (0)