|
| 1 | +linters-settings: |
| 2 | + errcheck: |
| 3 | + ignore: fmt:.*,go.uber.org/zap/zapcore:^Add.* |
| 4 | + ignoretests: true |
| 5 | + gci: |
| 6 | + sections: |
| 7 | + - standard # Standard section: captures all standard packages. |
| 8 | + - default # Default section: contains all imports that could not be matched to another section type. |
| 9 | + - prefix(github.com/caddyserver/caddy/v2/cmd) # ensure that this is always at the top and always has a line break. |
| 10 | + - prefix(github.com/caddyserver/caddy) # Custom section: groups all imports with the specified Prefix. |
| 11 | + # Skip generated files. |
| 12 | + # Default: true |
| 13 | + skip-generated: true |
| 14 | + # Enable custom order of sections. |
| 15 | + # If `true`, make the section order the same as the order of `sections`. |
| 16 | + # Default: false |
| 17 | + custom-order: true |
| 18 | + exhaustive: |
| 19 | + ignore-enum-types: reflect.Kind|svc.Cmd |
| 20 | + |
| 21 | +linters: |
| 22 | + disable-all: true |
| 23 | + enable: |
| 24 | + - asasalint |
| 25 | + - asciicheck |
| 26 | + - bidichk |
| 27 | + - bodyclose |
| 28 | + - decorder |
| 29 | + - dogsled |
| 30 | + - dupl |
| 31 | + - dupword |
| 32 | + - durationcheck |
| 33 | + - errcheck |
| 34 | + - errname |
| 35 | + - exhaustive |
| 36 | + - exportloopref |
| 37 | + - gci |
| 38 | + - gofmt |
| 39 | + - goimports |
| 40 | + - gofumpt |
| 41 | + - gosec |
| 42 | + - gosimple |
| 43 | + - govet |
| 44 | + - ineffassign |
| 45 | + - importas |
| 46 | + - misspell |
| 47 | + - prealloc |
| 48 | + - promlinter |
| 49 | + - sloglint |
| 50 | + - sqlclosecheck |
| 51 | + - staticcheck |
| 52 | + - tenv |
| 53 | + - testableexamples |
| 54 | + - testifylint |
| 55 | + - tparallel |
| 56 | + - typecheck |
| 57 | + - unconvert |
| 58 | + - unused |
| 59 | + - wastedassign |
| 60 | + - whitespace |
| 61 | + - zerologlint |
| 62 | + # these are implicitly disabled: |
| 63 | + # - containedctx |
| 64 | + # - contextcheck |
| 65 | + # - cyclop |
| 66 | + # - depguard |
| 67 | + # - errchkjson |
| 68 | + # - errorlint |
| 69 | + # - exhaustruct |
| 70 | + # - execinquery |
| 71 | + # - exhaustruct |
| 72 | + # - forbidigo |
| 73 | + # - forcetypeassert |
| 74 | + # - funlen |
| 75 | + # - ginkgolinter |
| 76 | + # - gocheckcompilerdirectives |
| 77 | + # - gochecknoglobals |
| 78 | + # - gochecknoinits |
| 79 | + # - gochecksumtype |
| 80 | + # - gocognit |
| 81 | + # - goconst |
| 82 | + # - gocritic |
| 83 | + # - gocyclo |
| 84 | + # - godot |
| 85 | + # - godox |
| 86 | + # - goerr113 |
| 87 | + # - goheader |
| 88 | + # - gomnd |
| 89 | + # - gomoddirectives |
| 90 | + # - gomodguard |
| 91 | + # - goprintffuncname |
| 92 | + # - gosmopolitan |
| 93 | + # - grouper |
| 94 | + # - inamedparam |
| 95 | + # - interfacebloat |
| 96 | + # - ireturn |
| 97 | + # - lll |
| 98 | + # - loggercheck |
| 99 | + # - maintidx |
| 100 | + # - makezero |
| 101 | + # - mirror |
| 102 | + # - musttag |
| 103 | + # - nakedret |
| 104 | + # - nestif |
| 105 | + # - nilerr |
| 106 | + # - nilnil |
| 107 | + # - nlreturn |
| 108 | + # - noctx |
| 109 | + # - nolintlint |
| 110 | + # - nonamedreturns |
| 111 | + # - nosprintfhostport |
| 112 | + # - paralleltest |
| 113 | + # - perfsprint |
| 114 | + # - predeclared |
| 115 | + # - protogetter |
| 116 | + # - reassign |
| 117 | + # - revive |
| 118 | + # - rowserrcheck |
| 119 | + # - stylecheck |
| 120 | + # - tagalign |
| 121 | + # - tagliatelle |
| 122 | + # - testpackage |
| 123 | + # - thelper |
| 124 | + # - unparam |
| 125 | + # - usestdlibvars |
| 126 | + # - varnamelen |
| 127 | + # - wrapcheck |
| 128 | + # - wsl |
| 129 | + |
| 130 | +run: |
| 131 | + # default concurrency is a available CPU number. |
| 132 | + # concurrency: 4 # explicitly omit this value to fully utilize available resources. |
| 133 | + deadline: 5m |
| 134 | + issues-exit-code: 1 |
| 135 | + tests: false |
| 136 | + |
| 137 | +# output configuration options |
| 138 | +output: |
| 139 | + format: 'colored-line-number' |
| 140 | + print-issued-lines: true |
| 141 | + print-linter-name: true |
| 142 | + |
| 143 | +issues: |
| 144 | + exclude-rules: |
| 145 | + # we aren't calling unknown URL |
| 146 | + - text: 'G107' # G107: Url provided to HTTP request as taint input |
| 147 | + linters: |
| 148 | + - gosec |
| 149 | + # as a web server that's expected to handle any template, this is totally in the hands of the user. |
| 150 | + - text: 'G203' # G203: Use of unescaped data in HTML templates |
| 151 | + linters: |
| 152 | + - gosec |
| 153 | + # we're shelling out to known commands, not relying on user-defined input. |
| 154 | + - text: 'G204' # G204: Audit use of command execution |
| 155 | + linters: |
| 156 | + - gosec |
| 157 | + # the choice of weakrand is deliberate, hence the named import "weakrand" |
| 158 | + - path: modules/caddyhttp/reverseproxy/selectionpolicies.go |
| 159 | + text: 'G404' # G404: Insecure random number source (rand) |
| 160 | + linters: |
| 161 | + - gosec |
| 162 | + - path: modules/caddyhttp/reverseproxy/streaming.go |
| 163 | + text: 'G404' # G404: Insecure random number source (rand) |
| 164 | + linters: |
| 165 | + - gosec |
| 166 | + - path: modules/logging/filters.go |
| 167 | + linters: |
| 168 | + - dupl |
0 commit comments