|
1 | | -# Options for analysis running. |
2 | | -run: |
3 | | - # Timeout for analysis, e.g. 30s, 5m. |
4 | | - # Default: 1m |
5 | | - timeout: 5m |
6 | | - # Which dirs to skip: issues from them won't be reported. |
7 | | - # Can use regexp here: `generated.*`, regexp is applied on full path, |
8 | | - # including the path prefix if one is set. |
9 | | - # Default value is empty list, |
10 | | - # but default dirs are skipped independently of this option's value (see skip-dirs-use-default). |
11 | | - # "/" will be replaced by current OS file path separator to properly work on Windows. |
12 | | - # skip-dirs: [] |
13 | | - # Which files to skip: they will be analyzed, but issues from them won't be reported. |
14 | | - # Default value is empty list, |
15 | | - # but there is no need to include all autogenerated files, |
16 | | - # we confidently recognize autogenerated files. |
17 | | - # If it's not please let us know. |
18 | | - # "/" will be replaced by current OS file path separator to properly work on Windows. |
19 | | - # skip-files: [] |
20 | | - |
21 | | -# output configuration options |
22 | | -# output: |
23 | | -# Format: colored-line-number|line-number|json|colored-tab|tab|checkstyle|code-climate|junit-xml|github-actions|teamcity |
24 | | -# |
25 | | -# Multiple can be specified by separating them by comma, output can be provided |
26 | | -# for each of them by separating format name and path by colon symbol. |
27 | | -# Output path can be either `stdout`, `stderr` or path to the file to write to. |
28 | | -# Example: "checkstyle:report.xml,json:stdout,colored-line-number" |
29 | | -# |
30 | | -# Default: colored-line-number |
31 | | -# formats: colored-line-number |
32 | | - |
33 | | -# Re-enable excluded linters. Restores missing documentation checks, among |
34 | | -# others. |
35 | | -# https://golangci-lint.run/usage/false-positives/#default-exclusions |
36 | | -# https://github.com/golangci/golangci-lint/issues/456#issuecomment-986837325 |
37 | | -issues: |
38 | | - exclude-use-default: false |
39 | | - exclude-rules: |
40 | | - # Exclude some linters from running on tests files. |
41 | | - - path: _test\.go |
42 | | - linters: |
43 | | - - funlen |
44 | | - - goerr113 |
45 | | - - err113 |
46 | | - - wrapcheck |
47 | | - - maintidx |
48 | | - - path: registry/funcs\.go |
49 | | - linters: |
50 | | - - err113 |
51 | | - |
| 1 | +version: "2" |
52 | 2 | linters: |
53 | | - # Enable specific linter |
54 | | - # https://golangci-lint.run/usage/linters/#enabled-by-default |
55 | | - # enable: [] |
56 | | - |
57 | | - # Enable all available linters. |
58 | | - # Default: false |
59 | | - enable-all: true |
60 | | - |
61 | | - # Disable specific linter |
62 | | - # https://golangci-lint.run/usage/linters/#disabled-by-default |
| 3 | + default: all |
63 | 4 | disable: |
64 | | - # Deprecated |
65 | | - - exportloopref # Replaced by copyloopvar |
66 | | - |
67 | 5 | # Too strict. |
| 6 | + - cyclop # redundant, covered by gocyclo |
68 | 7 | - depguard |
69 | | - - testpackage |
70 | | - - varnamelen |
71 | 8 | - exhaustruct |
72 | | - - cyclop # redundant, covered by gocyclo |
| 9 | + - funcorder # new, too much to move around |
| 10 | + - nestif # redundant, covered by gocyclo |
73 | 11 | - nlreturn |
| 12 | + - testpackage |
| 13 | + - varnamelen |
74 | 14 | - wsl |
75 | | - - nestif # redundant, covered by gocyclo |
76 | | - |
77 | | - # Enable presets. |
78 | | - # https://golangci-lint.run/usage/linters |
79 | | - presets: [] |
80 | | - |
81 | | - # Run only fast linters from enabled linters set (first run won't be fast) |
82 | | - # Default: false |
83 | | - # fast: true |
84 | | - |
85 | | -linters-settings: |
86 | | - errcheck: |
87 | | - check-type-assertions: false |
88 | | - check-blank: false |
89 | | - disable-default-exclusions: false |
90 | | - exclude-functions: |
91 | | - - fmt.Fprintf |
92 | | - - fmt.Fprintln |
93 | | - - fmt.Fprint |
94 | | - funlen: |
95 | | - # Ignore comments when counting lines. |
96 | | - ignore-comments: true |
97 | | - exhaustive: |
98 | | - default-signifies-exhaustive: true |
99 | | - ireturn: |
100 | | - # ireturn does not allow using `allow` and `reject` settings at the same time. |
101 | | - # Both settings are lists of the keywords and regular expressions matched to interface or package names. |
102 | | - # keywords: |
103 | | - # - `empty` for `any` |
104 | | - # - `error` for errors |
105 | | - # - `stdlib` for standard library |
106 | | - # - `anon` for anonymous interfaces |
107 | | - # - `generic` for generic interfaces added in go 1.18 |
108 | | - |
109 | | - # By default, it allows using errors, empty interfaces, anonymous interfaces, |
110 | | - # and interfaces provided by the standard library. |
111 | | - allow: |
112 | | - - anon |
113 | | - - error |
114 | | - - empty |
115 | | - - stdlib |
116 | | - - generic |
117 | | - - spec\.JSONPathValue |
118 | | - - spec\.FunctionExprArg |
119 | | - - spec\.Selector |
120 | | - - spec\.BasicExpr |
121 | | - - spec\.CompVal |
122 | | - # You can specify idiomatic endings for interface |
123 | | - # - (or|er)$ |
124 | | - # reject-list of interfaces |
125 | | - # reject: |
126 | | - # - github.com\/user\/package\/v4\.Type |
127 | | - dupword: |
128 | | - ignore: |
129 | | - - R. |
| 15 | + settings: |
| 16 | + dupword: |
| 17 | + ignore: |
| 18 | + - R. |
| 19 | + errcheck: |
| 20 | + disable-default-exclusions: false |
| 21 | + check-type-assertions: false |
| 22 | + check-blank: false |
| 23 | + exclude-functions: |
| 24 | + - fmt.Fprintf |
| 25 | + - fmt.Fprintln |
| 26 | + - fmt.Fprint |
| 27 | + exhaustive: |
| 28 | + default-signifies-exhaustive: true |
| 29 | + funlen: |
| 30 | + ignore-comments: true |
| 31 | + ireturn: |
| 32 | + allow: |
| 33 | + - anon |
| 34 | + - error |
| 35 | + - empty |
| 36 | + - stdlib |
| 37 | + - generic |
| 38 | + - spec\.JSONPathValue |
| 39 | + - spec\.FunctionExprArg |
| 40 | + - spec\.Selector |
| 41 | + - spec\.BasicExpr |
| 42 | + - spec\.CompVal |
| 43 | + exclusions: |
| 44 | + generated: lax |
| 45 | + rules: |
| 46 | + # Exclude some linters from running on tests files. |
| 47 | + - linters: |
| 48 | + - err113 |
| 49 | + - funlen |
| 50 | + - maintidx |
| 51 | + - wrapcheck |
| 52 | + path: _test\.go |
| 53 | + - linters: |
| 54 | + - err113 |
| 55 | + path: registry/funcs\.go |
| 56 | + paths: |
| 57 | + - third_party$ |
| 58 | + - builtin$ |
| 59 | + - examples$ |
| 60 | +formatters: |
| 61 | + enable: |
| 62 | + - gci |
| 63 | + - gofmt |
| 64 | + - gofumpt |
| 65 | + - goimports |
| 66 | + exclusions: |
| 67 | + generated: lax |
| 68 | + paths: |
| 69 | + - third_party$ |
| 70 | + - builtin$ |
| 71 | + - examples$ |
0 commit comments