Skip to content

Commit

Permalink
chore: Bump golangci-lint v1.57
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Mar 26, 2024
1 parent 7b1512a commit 6cdda96
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,4 @@ jobs:
# Required: the version of golangci-lint is required and must be
# specified without patch version: we always use the latest patch
# version.
version: v1.52

# Optional: show only new issues if it's a pull request. The default
# value is `false`. Be careful upgrading because this won't show
# existing lints.
only-new-issues: true
version: v1.57
8 changes: 6 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ run:

linters-settings:
govet:
check-shadowing: true
enable-all: true
disable:
composites # same as exhaustruct below
- composites # same as exhaustruct below
- fieldalignment
asasalint:
exclude:
- glog\.Infof
Expand All @@ -33,13 +34,15 @@ linters:
disable:
- cyclop # boo cyclomatic complexity
- dupl # exclude test code
- depguard
- errcheck # handled by gosec, lots of false posi
- exhaustive # this false-positives for switches with a default
- exhaustivestruct # too noisy, labelling fields is not my jam
- exhaustruct # above, renamed
- forbidigo # exclude non prod tools
- forcetypeassert # too many at the moment
- funlen # My tests will be as long as they need to be thanks
- gci
- gochecknoglobals # Flags are fine, as are test tables.
- gochecknoinits # How dare you tell me not to use inits.
- gocognit # boo cyclomatic complexity
Expand All @@ -58,6 +61,7 @@ linters:
- nlreturn # Not a fan of this one, looks messy
- nolintlint # broken on gocritic
- paralleltest # i had a good reason for this
- perfsprint
- testpackage # need to test internal methods
- unparam # too noisy
- whitespace # broken by goyacc
Expand Down
2 changes: 1 addition & 1 deletion cmd/mdot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func main() {
}

http.HandleFunc("/",
func(w http.ResponseWriter, r *http.Request) {
func(w http.ResponseWriter, _ *http.Request) {
dot := exec.Command("dot", "-Tsvg")
in, err := dot.StdinPipe()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func timeGenerator(rand *rand.Rand) time.Time {

func TestMetricJSONRoundTrip(t *testing.T) {
rand := rand.New(rand.NewSource(0))
f := func(name, prog string, kind Kind, keys []string, val, ti, tns int64) bool {
f := func(name, prog string, kind Kind, keys []string, val, _, _ int64) bool {
m := NewMetric(name, prog, kind, Int, keys...)
labels := make([]string, 0)
for range keys {
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/store_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func BenchmarkStore(b *testing.B) {
fillMetric(b, rand, items, m, s)
addToStore(b, items, *m, s)
},
b: func(b *testing.B, items int, m []*Metric, s *Store) {
b: func(b *testing.B, _ int, _ []*Metric, s *Store) {
b.Helper()
s.Range(func(*Metric) error {
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/mtail/mtail.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"github.com/google/mtail/internal/tailer"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"
vc "github.com/prometheus/client_golang/prometheus/collectors/version"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/version"
"go.opencensus.io/zpages"
)
Expand Down

0 comments on commit 6cdda96

Please sign in to comment.