Skip to content

Commit a6bdf42

Browse files
committed
Update for golangci-lint v1.42.0
1 parent 69ef814 commit a6bdf42

File tree

2 files changed

+54
-9
lines changed

2 files changed

+54
-9
lines changed

.golangci.yml

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
linters-settings:
33
cyclop:
44
# NOTE: This is a very high transitional threshold
5-
max-complexity: 36
6-
package-average: 10.0
5+
max-complexity: 38
6+
package-average: 34.0
77
skip-tests: true
88

99
gocognit:
@@ -26,13 +26,58 @@ linters-settings:
2626
default-signifies-exhaustive: true
2727

2828
nestif:
29-
min-complexity: 7
29+
min-complexity: 10
3030

3131
nolintlint:
3232
require-explanation: true
3333
allow-unused: false
3434
require-specific: true
3535

36+
revive:
37+
ignore-generated-header: true
38+
severity: warning
39+
rules:
40+
- name: atomic
41+
- name: blank-imports
42+
- name: bool-literal-in-expr
43+
- name: confusing-naming
44+
- name: constant-logical-expr
45+
- name: context-as-argument
46+
- name: context-keys-type
47+
- name: deep-exit
48+
- name: defer
49+
- name: range-val-in-closure
50+
- name: range-val-address
51+
- name: dot-imports
52+
- name: empty-block
53+
- name: error-naming
54+
- name: error-return
55+
- name: error-strings
56+
- name: errorf
57+
- name: exported
58+
- name: identical-branches
59+
- name: if-return
60+
- name: import-shadowing
61+
- name: increment-decrement
62+
- name: indent-error-flow
63+
- name: indent-error-flow
64+
- name: package-comments
65+
- name: range
66+
- name: receiver-naming
67+
- name: redefines-builtin-id
68+
- name: superfluous-else
69+
- name: struct-tag
70+
- name: time-naming
71+
- name: unexported-naming
72+
- name: unexported-return
73+
- name: unnecessary-stmt
74+
- name: unreachable-code
75+
- name: unused-parameter
76+
- name: var-declaration
77+
- name: var-naming
78+
- name: unconditional-recursion
79+
- name: waitgroup-by-value
80+
3681
staticcheck:
3782
go: "1.16"
3883

@@ -53,6 +98,8 @@ linters:
5398
- dupl
5499
- durationcheck
55100
- errcheck
101+
# errname is only available in golangci-lint v1.42.0+ - wait until v1.43 is available to settle
102+
#- errname
56103
- errorlint
57104
- exhaustive
58105
- exportloopref
@@ -141,8 +188,6 @@ issues:
141188
- tparallel
142189
text: "call t.Parallel on the top level as well as its subtests"
143190

144-
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
145-
max-same-issues: 10
146-
147-
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
148-
max-issues-per-linter: 100
191+
# Don't hide lint issues just because there are many of them
192+
max-same-issues: 0
193+
max-issues-per-linter: 0

Makefile.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# BEGIN: lint-install {{.Args}}
33

4-
GOLINT_VERSION ?= v1.41.1
4+
GOLINT_VERSION ?= v1.42.0
55
HADOLINT_VERSION ?= v2.6.1
66
SHELLCHECK_VERSION ?= v0.7.2
77
LINT_OS := $(shell uname)

0 commit comments

Comments
 (0)