|
1 | | -linters-settings: |
2 | | - revive: |
3 | | - rules: |
4 | | - - name: unused-parameter |
5 | | - disabled: true |
6 | | - - name: if-return |
7 | | - disabled: true |
8 | | - govet: |
9 | | - check-shadowing: true |
10 | | - gocyclo: |
11 | | - min-complexity: 15 |
12 | | - maligned: |
13 | | - suggest-new: true |
14 | | - dupl: |
15 | | - threshold: 120 |
16 | | - goconst: |
17 | | - min-len: 2 |
18 | | - min-occurrences: 3 |
19 | | - misspell: |
20 | | - locale: US |
21 | | - lll: |
22 | | - line-length: 140 |
23 | | - goimports: |
24 | | - local-prefixes: github.com/gotd/botapi |
25 | | - gocritic: |
26 | | - enabled-tags: |
27 | | - - diagnostic |
28 | | - - experimental |
29 | | - - opinionated |
30 | | - - performance |
31 | | - - style |
32 | | - disabled-checks: |
33 | | - - hugeParam |
34 | | - - rangeValCopy |
35 | | - - exitAfterDefer |
36 | | - - whyNoLint |
37 | | - - singleCaseSwitch |
38 | | - - commentedOutCode |
| 1 | +version: "2" |
39 | 2 |
|
40 | 3 | linters: |
41 | | - disable-all: true |
| 4 | + default: none |
42 | 5 | enable: |
43 | 6 | - dogsled |
44 | | - # False positive: botapi has a lot of similar unimplemented methods |
45 | | - # - dupl |
46 | 7 | - errcheck |
| 8 | + # Exhaustiveness of switches over typed enums (ParseMode, ChatType, ...). |
| 9 | + - exhaustive |
| 10 | + # Exhaustiveness of switches over sealed-interface unions (ChatID, |
| 11 | + # ReplyMarkup, ChatMember, ...). These are the "sum types" of this package: |
| 12 | + # interfaces with an unexported marker method. |
| 13 | + - gochecksumtype |
47 | 14 | - gochecknoinits |
48 | 15 | - goconst |
49 | 16 | - gocritic |
50 | | - - gofmt |
51 | | - - goimports |
52 | 17 | - revive |
53 | 18 | - gosec |
54 | 19 | - govet |
55 | 20 | - ineffassign |
56 | 21 | - lll |
57 | 22 | - misspell |
58 | 23 | - nakedret |
59 | | - - typecheck |
60 | 24 | - unconvert |
61 | 25 | - unparam |
62 | 26 | - whitespace |
| 27 | + settings: |
| 28 | + revive: |
| 29 | + rules: |
| 30 | + - name: unused-parameter |
| 31 | + disabled: true |
| 32 | + - name: if-return |
| 33 | + disabled: true |
| 34 | + govet: |
| 35 | + enable: |
| 36 | + - shadow |
| 37 | + goconst: |
| 38 | + min-len: 2 |
| 39 | + min-occurrences: 3 |
| 40 | + misspell: |
| 41 | + locale: US |
| 42 | + lll: |
| 43 | + line-length: 140 |
| 44 | + exhaustive: |
| 45 | + # A `default:` case counts as covering the remaining variants. |
| 46 | + default-signifies-exhaustive: true |
| 47 | + gochecksumtype: |
| 48 | + # A `default:` case counts as covering the remaining variants. |
| 49 | + default-signifies-exhaustive: true |
| 50 | + gocritic: |
| 51 | + enabled-tags: |
| 52 | + - diagnostic |
| 53 | + - experimental |
| 54 | + - opinionated |
| 55 | + - performance |
| 56 | + - style |
| 57 | + disabled-checks: |
| 58 | + - hugeParam |
| 59 | + - rangeValCopy |
| 60 | + - exitAfterDefer |
| 61 | + - whyNoLint |
| 62 | + - singleCaseSwitch |
| 63 | + - commentedOutCode |
| 64 | + exclusions: |
| 65 | + rules: |
| 66 | + - linters: [gocritic] |
| 67 | + text: "commentedOutCode" |
| 68 | + source: "SHA1" |
| 69 | + # Allow embed globals. |
| 70 | + - source: "embed\\.FS" |
| 71 | + linters: [gochecknoglobals] |
| 72 | + # Exclude go:generate from lll. |
| 73 | + - source: "//go:generate" |
| 74 | + linters: [lll] |
| 75 | + # Relax noisy linters in tests. |
| 76 | + - path: _test\.go |
| 77 | + linters: |
| 78 | + - errcheck |
| 79 | + - gosec |
| 80 | + - goconst |
| 81 | + - lll |
| 82 | + # Ignore shadowing of common names. |
| 83 | + - linters: [govet] |
| 84 | + text: 'declaration of "(err|ctx|log)"' |
| 85 | + - path: internal\.go |
| 86 | + text: "should have.+comment" |
| 87 | + linters: [revive] |
| 88 | + # Allow underscores in package names. |
| 89 | + - linters: [revive] |
| 90 | + text: "underscores? in package names?" |
| 91 | + - linters: [staticcheck] |
| 92 | + text: "SA1019: (telegram|client).+ is deprecated:" |
| 93 | + # G115 (integer overflow on conversion) is noisy on known-safe size/index |
| 94 | + # conversions in storage and doc parsing. |
| 95 | + - linters: [gosec] |
| 96 | + text: "G115:" |
63 | 97 |
|
64 | | - # Do not enable: |
65 | | - # - wsl (too opinionated about newlines) |
66 | | - # - godox (todos are OK) |
67 | | - # - bodyclose (false positives on helper functions) |
68 | | - # - prealloc (not worth it in scope of this project) |
69 | | - # - maligned (same as prealloc) |
70 | | - # - funlen (gocyclo is enough) |
71 | | - # - gochecknoglobals |
72 | | - # - gocognit |
73 | | -issues: |
74 | | - exclude-use-default: false |
75 | | - exclude-rules: |
76 | | - - linters: [gocritic] |
77 | | - text: "commentedOutCode" |
78 | | - source: "SHA1" |
79 | | - |
80 | | - # Allow embed globals |
81 | | - - source: "embed\\.FS" |
82 | | - linters: [gochecknoglobals] |
83 | | - |
84 | | - # Exclude go:generate from lll |
85 | | - - source: "//go:generate" |
86 | | - linters: [lll] |
87 | | - |
88 | | - # Disable linters that are annoying in tests. |
89 | | - - path: _test\.go |
90 | | - linters: |
91 | | - - gocyclo |
92 | | - - errcheck |
93 | | - - dupl |
94 | | - - gosec |
95 | | - - funlen |
96 | | - - goconst |
97 | | - - gocognit |
98 | | - - scopelint |
99 | | - - lll |
100 | | - - gochecknoglobals |
101 | | - # Ignore shadowing of err. |
102 | | - - linters: [govet] |
103 | | - text: 'declaration of "(err|ctx|log)"' |
104 | | - |
105 | | - - path: internal\.go |
106 | | - text: "should have.+comment" |
107 | | - linters: [revive] |
108 | | - |
109 | | - # Allow underscores in package names. |
110 | | - - linters: [revive, stylecheck] |
111 | | - text: "underscores? in package names?" |
112 | | - |
113 | | - - linters: [staticcheck] |
114 | | - text: "SA1019: (telegram|client).+ is deprecated:" |
115 | | - |
116 | | - - linters: [typecheck] |
117 | | - text: "missing type in composite literal" |
118 | | - |
119 | | - # TODO: Rewrite |
120 | | - - path: pool\.go |
121 | | - linters: [revive, govet, gocritic, misspell] |
| 98 | +formatters: |
| 99 | + enable: |
| 100 | + - gofmt |
| 101 | + - goimports |
| 102 | + settings: |
| 103 | + goimports: |
| 104 | + local-prefixes: |
| 105 | + - github.com/gotd/botapi |
0 commit comments