You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/cli/.golangci.yml
+51-33Lines changed: 51 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,15 @@ linters-settings:
18
18
- name: blank-imports
19
19
- name: context-as-argument
20
20
- name: context-keys-type
21
+
- name: defer
21
22
- name: dot-imports
22
23
- name: error-return
23
24
- name: error-strings
24
25
- name: error-naming
26
+
- name: early-return
25
27
- name: errorf
26
28
- name: exported
29
+
- name: import-shadowing
27
30
- name: indent-error-flow
28
31
- name: if-return
29
32
- name: increment-decrement
@@ -42,6 +45,14 @@ linters-settings:
42
45
- name: unused-parameter
43
46
- name: unreachable-code
44
47
- name: redefines-builtin-id
48
+
- name: unused-receiver
49
+
- name: constant-logical-expr
50
+
- name: confusing-naming
51
+
- name: unnecessary-stmt
52
+
- name: use-any
53
+
- name: imports-blocklist
54
+
arguments:
55
+
- "github.com/pkg/errors"
45
56
misspell:
46
57
locale: US
47
58
lll:
@@ -52,42 +63,49 @@ linters-settings:
52
63
funlen:
53
64
lines: 360
54
65
statements: 120
66
+
gci:
67
+
sections:
68
+
- standard
69
+
- default
55
70
linters:
56
71
disable-all: true
57
72
enable:
58
-
- dogsled
59
-
- errcheck
60
-
- funlen
61
-
- gocritic
62
-
- gofmt
63
-
- goimports
64
-
- revive
65
-
- goprintffuncname
66
-
- gosec
67
-
- gosimple
68
-
- govet
69
-
- ineffassign
70
-
- lll
71
-
- misspell
72
-
- nakedret
73
-
- nolintlint
74
-
- rowserrcheck
75
-
- copyloopvar
76
-
- staticcheck
77
-
- stylecheck
78
-
- typecheck
79
-
- unconvert
80
-
- unused
81
-
- whitespace
82
-
- thelper
83
-
- testifylint
84
-
- exhaustive
85
-
- makezero
86
-
- noctx
87
-
- tenv
88
-
- prealloc
89
-
- predeclared
90
-
- whitespace
73
+
- copyloopvar # copyloopvar is a linter detects places where loop variables are copied
74
+
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
75
+
- errcheck # errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases
76
+
- errorlint # Errorlint is a linter that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
77
+
- exhaustive # check exhaustiveness of enum switch statements
78
+
- copyloopvar # copyloopvar is a linter detects places where loop variables are copied. Replaces exportloopref since Go1.22
79
+
- funlen # Tool for detection of long functions
80
+
- gci # Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false]
81
+
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
82
+
- godot # Check if comments end in a period [fast: true, auto-fix: true]
83
+
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
84
+
- goimports # Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode.
85
+
- goprintffuncname # Checks that printf-like functions are named with `f` at the end.
86
+
- gosec # Inspects source code for security problems
87
+
- gosimple # Linter for Go source code that specializes in simplifying code
88
+
- govet # Vet examines Go source code and reports suspicious constructs. It is roughly the same as 'go vet' and uses its passes.
89
+
- ineffassign # Detects when assignments to existing variables are not used
90
+
- lll # Reports long lines
91
+
- makezero # Finds slice declarations with non-zero initial length
92
+
- misspell # Finds commonly misspelled English words
93
+
- nakedret # Checks that functions with naked returns are not longer than a maximum size (can be zero).
94
+
- noctx # Finds sending http request without context.Context
95
+
- nolintlint # Reports ill-formed or insufficient nolint directives
96
+
- perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative.
97
+
- prealloc # Finds slice declarations that could potentially be pre-allocated
98
+
- predeclared # find code that shadows one of Go's predeclared identifiers
99
+
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
100
+
- rowserrcheck # checks whether Rows.Err of rows is checked successfully
101
+
- staticcheck # It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint.
102
+
- stylecheck # Stylecheck is a replacement for golint
103
+
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
104
+
- testifylint # Checks usage of github.com/stretchr/testify.
105
+
- thelper # thelper detects tests helpers which is not start with t.Helper() method.
106
+
- unconvert # Remove unnecessary type conversions
107
+
- unused # Checks Go code for unused constants, variables, functions and types
108
+
- whitespace # Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc.
0 commit comments