|
1 | | ---- |
| 1 | +version: "2" |
2 | 2 | linters: |
3 | 3 | enable: |
4 | | - # check when errors are compared without errors.Is |
| 4 | + - dupword |
5 | 5 | - errorlint |
6 | | - |
7 | | - # check imports order and makes it always deterministic. |
8 | | - - gci |
9 | | - |
10 | | - # Very Basic spell error checker |
| 6 | + - mirror |
11 | 7 | - misspell |
12 | | - |
13 | | - # Fast, configurable, extensible, flexible, and beautiful linter for Go. |
14 | | - # Drop-in replacement of golint. |
15 | | - - revive |
16 | | - |
17 | | - # make sure to use t.Helper() when needed |
18 | | - - thelper |
19 | | - |
20 | | - # ensure that lint exceptions have explanations. Consider the case below: |
21 | 8 | - nolintlint |
22 | | - |
23 | | - # detect duplicated words in code |
24 | | - - dupword |
25 | | - |
26 | | - # mirror suggests rewrites to avoid unnecessary []byte/string conversion |
27 | | - - mirror |
28 | | - |
29 | | - # testify checks good usage of github.com/stretchr/testify. |
| 9 | + - revive |
30 | 10 | - testifylint |
31 | | - |
32 | | -linters-settings: |
33 | | - dupword: |
34 | | - # Keywords used to ignore detection. |
35 | | - # Default: [] |
36 | | - ignore: |
37 | | - - "FAIL" # "FAIL FAIL" is tolerated |
38 | | - |
39 | | - nolintlint: |
40 | | - # Disable to ensure that all nolint directives actually have an effect. |
41 | | - # Default: false |
42 | | - allow-unused: true # too many false positive reported |
43 | | - # Exclude following linters from requiring an explanation. |
44 | | - # Default: [] |
45 | | - allow-no-explanation: [] |
46 | | - # Enable to require an explanation of nonzero length |
47 | | - # after each nolint directive. |
48 | | - # Default: false |
49 | | - require-explanation: true |
50 | | - # Enable to require nolint directives to mention the specific |
51 | | - # linter being suppressed. |
52 | | - # Default: false |
53 | | - require-specific: true |
54 | | - |
55 | | - revive: |
56 | | - rules: |
57 | | - - name: bare-return |
58 | | - - name: blank-imports |
59 | | - - name: comment-spacings |
60 | | - - name: context-as-argument |
61 | | - arguments: |
62 | | - - allowTypesBefore: "*testing.T" |
63 | | - - name: context-keys-type |
64 | | - - name: defer |
65 | | - arguments: |
66 | | - - ["call-chain", "loop"] |
67 | | - - name: dot-imports |
68 | | - - name: early-return |
69 | | - - name: empty-block |
70 | | - - name: error-return |
71 | | - - name: error-strings |
72 | | - - name: error-naming |
73 | | - - name: errorf |
74 | | - - name: exported |
75 | | - arguments: |
76 | | - # enables checking public methods of private types |
77 | | - - "checkPrivateReceivers" |
78 | | - # make error messages clearer |
79 | | - - "sayRepetitiveInsteadOfStutters" |
80 | | - - name: if-return |
81 | | - - name: import-shadowing |
82 | | - - name: increment-decrement |
83 | | - - name: indent-error-flow |
84 | | - - name: exported |
85 | | - - name: var-naming |
86 | | - - name: var-declaration |
87 | | - - name: package-comments |
88 | | - - name: range |
89 | | - - name: receiver-naming |
90 | | - - name: redefines-builtin-id |
91 | | - - name: superfluous-else |
92 | | - - name: time-naming |
93 | | - - name: time-equal |
94 | | - - name: unexported-return |
95 | | - - name: use-any |
96 | | - - name: unreachable-code |
97 | | - - name: unhandled-error |
98 | | - arguments: |
99 | | - - "fmt.Print.*" |
100 | | - - "fmt.Fprint.*" |
101 | | - - "bytes.Buffer.Write.*" |
102 | | - - "strings.Builder.Write.*" |
103 | | - - name: unused-parameter |
104 | | - - name: unused-receiver |
105 | | - - name: useless-break |
106 | | - |
107 | | - # define the import orders |
108 | | - gci: |
109 | | - sections: |
110 | | - # Standard section: captures all standard packages. |
111 | | - - standard |
112 | | - # Default section: catchall that is not standard or custom |
113 | | - - default |
114 | | - # Custom section: groups all imports with the specified Prefix. |
115 | | - - prefix(github.com/mfridman) |
116 | | - |
| 11 | + - thelper |
| 12 | + settings: |
| 13 | + dupword: |
| 14 | + ignore: |
| 15 | + - FAIL |
| 16 | + nolintlint: |
| 17 | + require-explanation: true |
| 18 | + require-specific: true |
| 19 | + allow-unused: true |
| 20 | + revive: |
| 21 | + rules: |
| 22 | + - name: bare-return |
| 23 | + - name: blank-imports |
| 24 | + - name: comment-spacings |
| 25 | + - name: context-as-argument |
| 26 | + arguments: |
| 27 | + - allowTypesBefore: '*testing.T' |
| 28 | + - name: context-keys-type |
| 29 | + - name: defer |
| 30 | + arguments: |
| 31 | + - - call-chain |
| 32 | + - loop |
| 33 | + - name: dot-imports |
| 34 | + - name: early-return |
| 35 | + - name: empty-block |
| 36 | + - name: error-return |
| 37 | + - name: error-strings |
| 38 | + - name: error-naming |
| 39 | + - name: errorf |
| 40 | + - name: exported |
| 41 | + arguments: |
| 42 | + - checkPrivateReceivers |
| 43 | + - sayRepetitiveInsteadOfStutters |
| 44 | + - name: if-return |
| 45 | + - name: import-shadowing |
| 46 | + - name: increment-decrement |
| 47 | + - name: indent-error-flow |
| 48 | + - name: exported |
| 49 | + - name: var-declaration |
| 50 | + - name: package-comments |
| 51 | + - name: range |
| 52 | + - name: receiver-naming |
| 53 | + - name: redefines-builtin-id |
| 54 | + - name: superfluous-else |
| 55 | + - name: time-naming |
| 56 | + - name: time-equal |
| 57 | + - name: unexported-return |
| 58 | + - name: use-any |
| 59 | + - name: unreachable-code |
| 60 | + - name: unhandled-error |
| 61 | + arguments: |
| 62 | + - fmt.Print.* |
| 63 | + - fmt.Fprint.* |
| 64 | + - bytes.Buffer.Write.* |
| 65 | + - strings.Builder.Write.* |
| 66 | + - name: unused-parameter |
| 67 | + - name: unused-receiver |
| 68 | + - name: useless-break |
| 69 | + exclusions: |
| 70 | + generated: lax |
| 71 | + presets: |
| 72 | + - comments |
| 73 | + - common-false-positives |
| 74 | + - legacy |
| 75 | + - std-error-handling |
| 76 | + paths: |
| 77 | + - third_party$ |
| 78 | + - builtin$ |
| 79 | + - examples$ |
| 80 | +formatters: |
| 81 | + enable: |
| 82 | + - gci |
| 83 | + settings: |
| 84 | + gci: |
| 85 | + sections: |
| 86 | + - standard |
| 87 | + - default |
| 88 | + - prefix(github.com/mfridman) |
| 89 | + exclusions: |
| 90 | + generated: lax |
| 91 | + paths: |
| 92 | + - third_party$ |
| 93 | + - builtin$ |
| 94 | + - examples$ |
0 commit comments