Commit 672ff7f44b
Verified · cmc
Layout: unified · split
.golangci.yml added +48
| @@ -0,0 +1,48 @@ | ||
| 1 | version: "2" | |
| 2 | ||
| 3 | linters: | |
| 4 | # standard = govet, errcheck, staticcheck, ineffassign, unused | |
| 5 | default: standard | |
| 6 | enable: | |
| 7 | # Correctness / security | |
| 8 | - bodyclose | |
| 9 | - noctx | |
| 10 | - gosec | |
| 11 | - forcetypeassert | |
| 12 | - canonicalheader | |
| 13 | - musttag | |
| 14 | - predeclared | |
| 15 | - exhaustive | |
| 16 | # Modernization | |
| 17 | - modernize | |
| 18 | - gocritic | |
| 19 | - mirror | |
| 20 | - perfsprint | |
| 21 | - intrange | |
| 22 | # Docs and style | |
| 23 | - revive | |
| 24 | - godot | |
| 25 | ||
| 26 | settings: | |
| 27 | revive: | |
| 28 | rules: | |
| 29 | # Requires a doc comment on every exported symbol, starting with the | |
| 30 | # symbol's own name. checkPrivateReceivers extends this to exported | |
| 31 | # methods on unexported types, which is most of the app package. | |
| 32 | - name: exported | |
| 33 | arguments: | |
| 34 | - checkPrivateReceivers | |
| 35 | staticcheck: | |
| 36 | # "all" turns on the doc-comment checks (ST1000/ST1020/ST1021/ST1022) and | |
| 37 | # the naming checks (ST1003), which are off by default. | |
| 38 | checks: | |
| 39 | - all | |
| 40 | ||
| 41 | exclusions: | |
| 42 | rules: | |
| 43 | # Test helpers make throwaway requests to a local httptest server; a | |
| 44 | # context and a closed body add noise without catching anything. | |
| 45 | - path: _test\.go$ | |
| 46 | linters: | |
| 47 | - bodyclose | |
| 48 | - noctx | |