|
| 1 | +version: "2" |
| 2 | + |
| 3 | +run: |
| 4 | + issues-exit-code: 1 |
| 5 | + tests: true |
| 6 | + |
| 7 | +formatters: |
| 8 | + enable: |
| 9 | + - gofmt |
| 10 | + - goimports |
| 11 | + |
| 12 | +linters: |
| 13 | + enable: |
| 14 | + - asasalint # Detects "[]any" used as argument for variadic "func(...any)". |
| 15 | + - copyloopvar # Detects places where loop variables are copied. |
| 16 | + - depguard |
| 17 | + - dogsled # Detects assignments with too many blank identifiers. |
| 18 | + - dupword # Detects duplicate words. |
| 19 | + - durationcheck # Detect cases where two time.Duration values are being multiplied in possibly erroneous ways. |
| 20 | + - errorlint # Detects code that will cause problems with the error wrapping scheme introduced in Go 1.13. |
| 21 | + - errchkjson # Detects unsupported types passed to json encoding functions and reports if checks for the returned error can be omitted. |
| 22 | + - exhaustive # Detects missing options in enum switch statements. |
| 23 | + - exptostd # Detects functions from golang.org/x/exp/ that can be replaced by std functions. |
| 24 | + - fatcontext # Detects nested contexts in loops and function literals. |
| 25 | + - forbidigo |
| 26 | + - gocheckcompilerdirectives # Detects invalid go compiler directive comments (//go:). |
| 27 | + - gocritic # Detects for bugs, performance and style issues. |
| 28 | + - gosec # Detects security problems. |
| 29 | + - govet |
| 30 | + - iface # Detects incorrect use of interfaces. Currently only used for "identical" interfaces in the same package. |
| 31 | + - importas |
| 32 | + - ineffassign |
| 33 | + - makezero # Finds slice declarations with non-zero initial length. |
| 34 | + - mirror # Detects wrong mirror patterns of bytes/strings usage. |
| 35 | + - misspell # Detects commonly misspelled English words in comments. |
| 36 | + - nakedret # Detects uses of naked returns. |
| 37 | + - nilnesserr # Detects returning nil errors. It combines the features of nilness and nilerr, |
| 38 | + - nosprintfhostport # Detects misuse of Sprintf to construct a host with port in a URL. |
| 39 | + - reassign # Detects reassigning a top-level variable in another package. |
| 40 | + - revive # Metalinter; drop-in replacement for golint. |
| 41 | + - spancheck # Detects mistakes with OpenTelemetry/Census spans. |
| 42 | + - staticcheck |
| 43 | + - thelper |
| 44 | + - unconvert # Detects unnecessary type conversions. |
| 45 | + - unused |
| 46 | + - usestdlibvars # Detects the possibility to use variables/constants from the Go standard library. |
| 47 | + - wastedassign # Detects wasted assignment statements. |
| 48 | + |
| 49 | + disable: |
| 50 | + - errcheck |
| 51 | + - depguard # TODO(austinvazquez): Enable this linter after fixing the issues it reports. |
| 52 | + |
| 53 | + settings: |
| 54 | + errorlint: |
| 55 | + # Check whether fmt.Errorf uses the %w verb for formatting errors. |
| 56 | + errorf: false |
| 57 | + # See the https://github.com/polyfloyd/go-errorlint for caveats. |
| 58 | + asserts: false |
| 59 | + |
| 60 | + gosec: |
| 61 | + excludes: |
| 62 | + - G304 # G304: Potential file inclusion via variable. |
| 63 | + - G306 # G306: Expect WriteFile permissions to be 0600 or less (too restrictive; also flags "0o644" permissions) |
| 64 | + |
| 65 | + revive: |
| 66 | + rules: |
| 67 | + - name: package-comments |
| 68 | + disabled: true |
| 69 | + |
| 70 | + staticcheck: |
| 71 | + checks: |
| 72 | + - all |
| 73 | + - -ST1000 # Incorrect or missing package comment; https://staticcheck.dev/docs/checks/#ST1000 |
| 74 | + - -ST1005 # Incorrectly formatted error string; https://staticcheck.dev/docs/checks/#ST1005 |
0 commit comments