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: .golangci.yml
+30-17
Original file line number
Diff line number
Diff line change
@@ -25,17 +25,32 @@ linters-settings:
25
25
- ^os.Exit$
26
26
- ^panic$
27
27
- ^print(ln)?$
28
+
varnamelen:
29
+
max-distance: 12
30
+
min-name-length: 2
31
+
ignore-type-assert-ok: true
32
+
ignore-map-index-ok: true
33
+
ignore-chan-recv-ok: true
34
+
ignore-decls:
35
+
- i int
36
+
- n int
37
+
- w io.Writer
38
+
- r io.Reader
39
+
- b []byte
28
40
29
41
linters:
30
42
enable:
31
43
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
32
44
- bidichk # Checks for dangerous unicode character sequences
33
45
- bodyclose # checks whether HTTP response body is closed successfully
46
+
- containedctx # containedctx is a linter that detects struct contained context.Context field
34
47
- contextcheck # check the function whether use a non-inherited context
48
+
- cyclop # checks function and package cyclomatic complexity
35
49
- decorder # check declaration order and count of types, constants, variables and functions
36
50
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
37
51
- dupl # Tool for code clone detection
38
52
- durationcheck # check for two durations multiplied together
53
+
- err113 # Golang linter to check the errors handling expressions
39
54
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
40
55
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted.
41
56
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
@@ -46,66 +61,64 @@ linters:
46
61
- forcetypeassert # finds forced type assertions
47
62
- gci # Gci control golang package import order and make it always deterministic.
48
63
- gochecknoglobals # Checks that no globals are present in Go code
49
-
- gochecknoinits # Checks that no init functions are present in Go code
50
64
- gocognit # Computes and checks the cognitive complexity of functions
51
65
- goconst # Finds repeated strings that could be replaced by a constant
52
66
- gocritic # The most opinionated Go source code linter
67
+
- gocyclo # Computes and checks the cyclomatic complexity of functions
68
+
- godot # Check if comments end in a period
53
69
- godox # Tool for detection of FIXME, TODO and other comment keywords
54
-
- err113 # Golang linter to check the errors handling expressions
55
70
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
56
71
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
57
72
- goheader # Checks is file header matches to pattern
58
73
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
59
74
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
60
-
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
61
75
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
62
76
- gosec # Inspects source code for security problems
63
77
- gosimple # Linter for Go source code that specializes in simplifying a code
64
78
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
65
79
- grouper # An analyzer to analyze expression groups.
66
80
- importas # Enforces consistent import aliases
67
81
- ineffassign # Detects when assignments to existing variables are not used
82
+
- lll # Reports long lines
83
+
- maintidx # maintidx measures the maintainability index of each function.
84
+
- makezero # Finds slice declarations with non-zero initial length
68
85
- misspell # Finds commonly misspelled English words in comments
86
+
- nakedret # Finds naked returns in functions greater than a specified function length
87
+
- nestif # Reports deeply nested if statements
69
88
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
70
89
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
90
+
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
71
91
- noctx # noctx finds sending http request without context.Context
72
92
- predeclared # find code that shadows one of Go's predeclared identifiers
- whitespace # Tool for detection of leading and trailing whitespace
85
106
disable:
86
107
- depguard # Go linter that checks if package imports are in a list of acceptable packages
87
-
- containedctx # containedctx is a linter that detects struct contained context.Context field
88
-
- cyclop # checks function and package cyclomatic complexity
89
108
- funlen # Tool for detection of long functions
90
-
- gocyclo# Computes and checks the cyclomatic complexity of functions
91
-
- godot# Check if comments end in a period
92
-
- gomnd# An analyzer to detect magic numbers.
109
+
- gochecknoinits# Checks that no init functions are present in Go code
110
+
- gomodguard# Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
111
+
- interfacebloat# A linter that checks length of interface.
0 commit comments