From d9d23685aed1895961c0b569875a8cc40a83682f Mon Sep 17 00:00:00 2001 From: Benji Vesterby Date: Sun, 11 Feb 2024 14:47:23 -0500 Subject: [PATCH] feat: update lint rules --- .golangci.yml | 10 ++++------ scaler_test.go | 1 + stream_test.go | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e247c2a..67083ea 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,8 +4,8 @@ run: timeout: 3m skip-dirs: - testdata - build-tags: - - codeanalysis + skip-files: + - docs.go # This file contains only configs which differ from defaults. @@ -46,7 +46,7 @@ linters-settings: gocognit: # Minimal code complexity to report # Default: 30 (but we recommend 10-20) - min-complexity: 40 + min-complexity: 30 gocritic: # Settings passed to gocritic. @@ -211,6 +211,7 @@ linters: - stylecheck # is a replacement for golint - tenv # detects using os.Setenv instead of t.Setenv since Go1.17 - testableexamples # checks if examples are testable (have an expected output) + #- testpackage # makes you use a separate _test package - tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes - unconvert # removes unnecessary type conversions - unparam # reports unused function parameters @@ -279,9 +280,6 @@ issues: linters: [ gocritic ] - source: "^\\s+if _, ok := err\\.\\([^.]+\\.InternalError\\); ok {" linters: [ errorlint ] - - path: "docs\\.go" - linters: - - lll - path: "_test\\.go" linters: - bodyclose diff --git a/scaler_test.go b/scaler_test.go index d29fb74..c3a1cfd 100644 --- a/scaler_test.go +++ b/scaler_test.go @@ -489,6 +489,7 @@ func FuzzScaler(f *testing.F) { }) } +//nolint:gocognit // This is a test function func Test_Scaler_Max(t *testing.T) { tests := map[string]struct { max uint diff --git a/stream_test.go b/stream_test.go index 09fe85b..5f5aa75 100644 --- a/stream_test.go +++ b/stream_test.go @@ -338,6 +338,7 @@ func Test_FanOut_Canceled_On_Wait(_ *testing.T) { FanOut(ctx, in, out) } +//nolint:gocognit // This is a test function func DistributeTest[U ~[]T, T comparable]( t *testing.T, name string,