Skip to content

Commit ffc4cc6

Browse files
authored
Merge pull request #1603 from prometheus/superq/cleanup_lint
Update linting
2 parents dbf72fc + e080e48 commit ffc4cc6

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

Diff for: .github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
3737
with:
3838
args: --verbose
39-
version: v1.59.1
39+
version: v1.60.2

Diff for: .golangci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ linters-settings:
6666
local-prefixes: github.com/prometheus/client_golang
6767
gofumpt:
6868
extra-rules: true
69+
predeclared:
70+
ignore: "min,max"
6971
revive:
7072
rules:
7173
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter

Diff for: Makefile.common

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT :=
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v1.59.1
64+
GOLANGCI_LINT_VERSION ?= v1.60.2
6565
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
6666
# windows isn't included here because of the path separator being different.
6767
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))

Diff for: prometheus/graphite/bridge_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"bufio"
1818
"bytes"
1919
"context"
20+
"errors"
2021
"fmt"
2122
"io"
2223
"log"
@@ -238,7 +239,7 @@ prefix.name_bucket;constname=constvalue;labelname=val2;le=+Inf 3 1477043
238239
got := buf.String()
239240

240241
if err := checkLinesAreEqual(want, got, useTags); err != nil {
241-
t.Fatalf(err.Error())
242+
t.Fatal(err.Error())
242243
}
243244
}
244245

@@ -290,7 +291,7 @@ prefix.name;constname=constvalue;labelname=val2 1 1477043
290291
got := buf.String()
291292

292293
if err := checkLinesAreEqual(want, got, useTags); err != nil {
293-
t.Fatalf(err.Error())
294+
t.Fatal(err.Error())
294295
}
295296
}
296297

@@ -322,7 +323,7 @@ func checkLinesAreEqual(w, g string, useTags bool) error {
322323
log += fmt.Sprintf("want: %v\ngot: %v\n\n", wantSplit, gotSplit)
323324

324325
if !reflect.DeepEqual(wantSplit, gotSplit) {
325-
return fmt.Errorf(log)
326+
return errors.New(log)
326327
}
327328
}
328329
return nil

Diff for: prometheus/testutil/testutil.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ package testutil
3939

4040
import (
4141
"bytes"
42+
"errors"
4243
"fmt"
4344
"io"
4445
"net/http"
@@ -310,7 +311,7 @@ func compare(got, want []*dto.MetricFamily) error {
310311
}
311312
}
312313
if diffErr := diff.Diff(gotBuf.String(), wantBuf.String()); diffErr != "" {
313-
return fmt.Errorf(diffErr)
314+
return errors.New(diffErr)
314315
}
315316
return nil
316317
}

0 commit comments

Comments
 (0)