Skip to content

Commit dd5a1cb

Browse files
committed
chore: update golangci-lint version
Signed-off-by: Donnie Adams <[email protected]>
1 parent 65dd96a commit dd5a1cb

File tree

3 files changed

+33
-20
lines changed

3 files changed

+33
-20
lines changed

.golangci.yaml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1+
version: "2"
12
run:
23
timeout: 5m
3-
4-
output:
5-
formats:
6-
- format: colored-line-number
7-
84
linters:
9-
disable-all: true
5+
default: none
106
enable:
117
- errcheck
12-
- gofmt
13-
- gosimple
148
- govet
159
- ineffassign
10+
- revive
1611
- staticcheck
17-
- typecheck
1812
- thelper
1913
- unused
20-
- goimports
2114
- whitespace
22-
- revive
23-
fast: false
24-
max-same-issues: 50
15+
exclusions:
16+
generated: lax
17+
presets:
18+
- comments
19+
- common-false-positives
20+
- legacy
21+
- std-error-handling
22+
paths:
23+
- third_party$
24+
- builtin$
25+
- examples$
26+
formatters:
27+
enable:
28+
- gofmt
29+
- goimports
30+
exclusions:
31+
generated: lax
32+
paths:
33+
- third_party$
34+
- builtin$
35+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tidy:
66
test:
77
go test -v ./...
88

9-
GOLANGCI_LINT_VERSION ?= v1.60.1
9+
GOLANGCI_LINT_VERSION ?= v2.1.2
1010
lint:
1111
if ! command -v golangci-lint &> /dev/null; then \
1212
echo "Could not find golangci-lint, installing version $(GOLANGCI_LINT_VERSION)."; \

gptscript_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ func TestRestartFailedRun(t *testing.T) {
567567
t.Errorf("Expected error but got nil")
568568
}
569569

570-
run.opts.GlobalOptions.Env = nil
570+
run.opts.Env = nil
571571
run, err = run.NextChat(context.Background(), "")
572572
if err != nil {
573573
t.Fatalf("Error executing next run: %v", err)
@@ -1037,21 +1037,23 @@ func TestToolWithGlobalTools(t *testing.T) {
10371037

10381038
for e := range run.Events() {
10391039
if e.Run != nil {
1040-
if e.Run.Type == EventTypeRunStart {
1040+
switch e.Run.Type {
1041+
case EventTypeRunStart:
10411042
runStartSeen = true
1042-
} else if e.Run.Type == EventTypeRunFinish {
1043+
case EventTypeRunFinish:
10431044
runFinishSeen = true
10441045
}
10451046
} else if e.Call != nil {
1046-
if e.Call.Type == EventTypeCallStart {
1047+
switch e.Call.Type {
1048+
case EventTypeCallStart:
10471049
callStartSeen = true
1048-
} else if e.Call.Type == EventTypeCallFinish {
1050+
case EventTypeCallFinish:
10491051
callFinishSeen = true
10501052

10511053
for _, o := range e.Call.Output {
10521054
eventContent += o.Content
10531055
}
1054-
} else if e.Call.Type == EventTypeCallProgress {
1056+
case EventTypeCallProgress:
10551057
callProgressSeen = true
10561058
}
10571059
}

0 commit comments

Comments
 (0)