|
| 1 | +version: "2" |
1 | 2 | run: |
2 | | - timeout: 5m |
3 | 3 | tests: true |
4 | | - |
5 | 4 | linters: |
6 | | - disable-all: true |
| 5 | + default: none |
7 | 6 | enable: |
8 | 7 | - errcheck |
9 | | - - gofmt |
10 | 8 | - govet |
11 | 9 | - ineffassign |
12 | 10 | - misspell |
13 | | - - gci |
14 | 11 | - revive |
15 | | - |
16 | | -linters-settings: |
17 | | - gci: |
18 | | - sections: |
19 | | - - standard |
20 | | - - default |
21 | | - - prefix(github.com/algorand) |
22 | | - - prefix(github.com/algorand/go-algorand) |
23 | | - |
24 | | - section-separators: |
25 | | - - newLine |
26 | | - |
| 12 | + exclusions: |
| 13 | + generated: lax |
| 14 | + rules: |
| 15 | + # revive: types is an acceptable package name in this codebase |
| 16 | + - linters: |
| 17 | + - revive |
| 18 | + path: types/ |
| 19 | + text: 'var-naming: avoid meaningless package names' |
| 20 | + # ignore govet false positive fixed in https://github.com/golang/go/issues/45043 |
| 21 | + - path: (.+)\.go$ |
| 22 | + text: 'sigchanyzer: misuse of unbuffered os.Signal channel as argument to signal.Notify' |
| 23 | + # ignore golint false positive fixed in https://github.com/golang/lint/pull/487 |
| 24 | + - path: (.+)\.go$ |
| 25 | + text: exported method (.*).Unwrap` should have comment or be unexported |
| 26 | + # ignore issues about the way we use _struct fields to define encoding settings |
| 27 | + - path: (.+)\.go$ |
| 28 | + text: '`_struct` is unused' |
| 29 | + # Enable some golangci-lint default exception rules: |
| 30 | + # "EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok" |
| 31 | + - path: (.+)\.go$ |
| 32 | + text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
| 33 | + # "EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore" |
| 34 | + - path: (.+)\.go$ |
| 35 | + text: ineffective break statement. Did you mean to break out of the outer loop |
| 36 | + # revive: ignore some rules |
| 37 | + - path: (.+)\.go$ |
| 38 | + text: '^unused-parameter: parameter' |
| 39 | + - path: (.+)\.go$ |
| 40 | + text: '^package-comments: should have a package comment' |
| 41 | + paths: |
| 42 | + - third_party$ |
| 43 | + - builtin$ |
| 44 | + - examples$ |
| 45 | +issues: |
| 46 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 47 | + max-issues-per-linter: 0 |
| 48 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 49 | + max-same-issues: 0 |
| 50 | + # use these new lint checks on code since #935 |
| 51 | + new-from-rev: 99ab66fdadcd77fef4048bb2aa86cae1f06c6e08 |
27 | 52 | severity: |
28 | | - default-severity: error |
| 53 | + default: error |
29 | 54 | rules: |
30 | 55 | - linters: |
31 | 56 | - errcheck |
| 57 | + - gci |
32 | 58 | - gofmt |
33 | 59 | - govet |
34 | 60 | - ineffassign |
35 | 61 | - misspell |
36 | | - - gci |
37 | 62 | - revive |
38 | 63 | severity: error |
39 | | - |
40 | | -issues: |
41 | | - # use these new lint checks on code since #935 |
42 | | - new-from-rev: 99ab66fdadcd77fef4048bb2aa86cae1f06c6e08 |
43 | | - |
44 | | - # Disable default exclude rules listed in `golangci-lint run --help` (selectively re-enable some below) |
45 | | - exclude-use-default: false |
46 | | - |
47 | | - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
48 | | - max-issues-per-linter: 0 |
49 | | - |
50 | | - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
51 | | - max-same-issues: 0 |
52 | | - |
53 | | - exclude: |
54 | | - # ignore govet false positive fixed in https://github.com/golang/go/issues/45043 |
55 | | - - "sigchanyzer: misuse of unbuffered os.Signal channel as argument to signal.Notify" |
56 | | - # ignore golint false positive fixed in https://github.com/golang/lint/pull/487 |
57 | | - - "exported method (.*).Unwrap` should have comment or be unexported" |
58 | | - # ignore issues about the way we use _struct fields to define encoding settings |
59 | | - - "`_struct` is unused" |
60 | | - |
61 | | - # Enable some golangci-lint default exception rules: |
62 | | - # "EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok" |
63 | | - - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
64 | | - # "EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore" |
65 | | - - ineffective break statement. Did you mean to break out of the outer loop |
66 | | - |
67 | | - # revive: ignore some rules |
68 | | - - "^unused-parameter: parameter" |
69 | | - - "^package-comments: should have a package comment" |
| 64 | +formatters: |
| 65 | + enable: |
| 66 | + - gci |
| 67 | + - gofmt |
| 68 | + settings: |
| 69 | + gci: |
| 70 | + sections: |
| 71 | + - standard |
| 72 | + - default |
| 73 | + - prefix(github.com/algorand) |
| 74 | + - prefix(github.com/algorand/go-algorand) |
| 75 | + exclusions: |
| 76 | + generated: lax |
| 77 | + paths: |
| 78 | + - third_party$ |
| 79 | + - builtin$ |
| 80 | + - examples$ |
0 commit comments