|
1 | | -# https://golangci-lint.run/usage/configuration/ |
2 | | -# To get the list of available linters: ./target/binutil/golangci-lint help linters |
3 | | - |
| 1 | +version: "2" |
4 | 2 | run: |
5 | 3 | issues-exit-code: 1 |
6 | 4 | tests: true |
7 | | - timeout: 5m |
8 | | - |
9 | 5 | output: |
10 | | - # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" |
11 | | - formats: colored-line-number |
12 | | - |
13 | | -linters-settings: |
14 | | - funlen: |
15 | | - lines: 100 |
16 | | - statements: 50 |
17 | | - ignore-comments: true |
18 | | - gocognit: |
19 | | - min-complexity: 10 |
20 | | - gocyclo: |
21 | | - min-complexity: 10 |
22 | | - gofmt: |
23 | | - simplify: true |
24 | | - misspell: |
25 | | - locale: US |
26 | | - whitespace: |
27 | | - multi-if: false # Enforces newlines (or comments) after every multi-line if statement |
28 | | - multi-func: false # Enforces newlines (or comments) after every multi-line function signature |
29 | | - depguard: |
30 | | - rules: |
31 | | - main: |
32 | | - files: |
33 | | - - $all |
34 | | - - "!$test" |
35 | | - allow: |
36 | | - - $gostd |
37 | | - - github.com/Vonage |
38 | | - test: |
39 | | - files: |
40 | | - - "$test" |
41 | | - allow: |
42 | | - - $gostd |
43 | | - - github.com/stretchr |
44 | | - gosec: |
45 | | - excludes: |
46 | | - # Flags for potentially-unsafe casting of ints, similar problem to globally-disabled G103 |
47 | | - - G115 |
48 | | - |
49 | | -issues: |
50 | | - exclude-dirs-use-default: true |
51 | | - exclude-dirs: |
52 | | - - .github |
53 | | - - .githook |
54 | | - exclude-rules: |
55 | | - - path: _test.go |
56 | | - linters: |
57 | | - - dupl |
58 | | - - funlen |
59 | | - # fix: true |
60 | | - |
| 6 | + formats: |
| 7 | + text: |
| 8 | + path: stdout |
61 | 9 | linters: |
62 | | - enable-all: true |
| 10 | + default: all |
63 | 11 | disable: |
64 | | - - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] |
65 | | - - exhaustruct # Checks if all structure fields are initialized [fast: false, auto-fix: false] |
66 | | - - err113 # Go linter to check the errors handling expressions [fast: false, auto-fix: false] |
67 | | - - ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false] |
68 | | - - lll # Reports long lines [fast: true, auto-fix: false] |
69 | | - - mnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] |
70 | | - - musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false] |
71 | | - - nlreturn # Accept Nil, Return Non-Nil [fast: false, auto-fix: false] |
72 | | - - tagliatelle # Checks the struct tags. [fast: true, auto-fix: false] |
73 | | - - testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] |
74 | | - - varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false] |
75 | | - - tenv # deprecated |
| 12 | + - depguard |
| 13 | + - err113 |
| 14 | + - exhaustruct |
| 15 | + - ireturn |
| 16 | + - lll |
| 17 | + - mnd |
| 18 | + - musttag |
| 19 | + - nlreturn |
| 20 | + - tagliatelle |
| 21 | + - testpackage |
| 22 | + - varnamelen |
| 23 | + settings: |
| 24 | + depguard: |
| 25 | + rules: |
| 26 | + main: |
| 27 | + files: |
| 28 | + - $all |
| 29 | + - '!$test' |
| 30 | + allow: |
| 31 | + - $gostd |
| 32 | + - github.com/Vonage |
| 33 | + test: |
| 34 | + files: |
| 35 | + - $test |
| 36 | + allow: |
| 37 | + - $gostd |
| 38 | + - github.com/stretchr |
| 39 | + funlen: |
| 40 | + lines: 100 |
| 41 | + statements: 50 |
| 42 | + ignore-comments: true |
| 43 | + gocognit: |
| 44 | + min-complexity: 10 |
| 45 | + gocyclo: |
| 46 | + min-complexity: 10 |
| 47 | + gosec: |
| 48 | + excludes: |
| 49 | + - G115 |
| 50 | + misspell: |
| 51 | + locale: US |
| 52 | + whitespace: |
| 53 | + multi-if: false |
| 54 | + multi-func: false |
| 55 | + exclusions: |
| 56 | + generated: lax |
| 57 | + presets: |
| 58 | + - comments |
| 59 | + - common-false-positives |
| 60 | + - legacy |
| 61 | + - std-error-handling |
| 62 | + rules: |
| 63 | + - linters: |
| 64 | + - dupl |
| 65 | + - funlen |
| 66 | + path: _test.go |
| 67 | + paths: |
| 68 | + - .github |
| 69 | + - .githook |
| 70 | + - third_party$ |
| 71 | + - builtin$ |
| 72 | + - examples$ |
| 73 | +formatters: |
| 74 | + enable: |
| 75 | + - gci |
| 76 | + - gofmt |
| 77 | + - gofumpt |
| 78 | + - goimports |
| 79 | + settings: |
| 80 | + gofmt: |
| 81 | + simplify: true |
| 82 | + exclusions: |
| 83 | + generated: lax |
| 84 | + paths: |
| 85 | + - .github |
| 86 | + - .githook |
| 87 | + - third_party$ |
| 88 | + - builtin$ |
| 89 | + - examples$ |
0 commit comments