| 1 |
# $schema: https://golangci-lint.run/jsonschema/golangci.jsonschema.json |
| 2 |
|
| 3 |
version: "2" |
| 4 |
linters: |
| 5 |
default: all |
| 6 |
disable: |
| 7 |
- depguard |
| 8 |
- err113 |
| 9 |
- exhaustruct |
| 10 |
- exhaustruct_v5 |
| 11 |
- funlen |
| 12 |
- gomodguard |
| 13 |
- ireturn |
| 14 |
- mnd |
| 15 |
- noinlineerr |
| 16 |
- recvcheck |
| 17 |
- wsl |
| 18 |
settings: |
| 19 |
forbidigo: |
| 20 |
forbid: |
| 21 |
- pattern: "^(fmt\\.Print(|f|ln)|print|println)$" |
| 22 |
- pattern: "fmt\\.Fprint(|f|ln)\\(stdout," |
| 23 |
- pattern: "os.Stderr" |
| 24 |
msg: "Direct use of os.Stderr is forbidden. Use a logger instead." |
| 25 |
- pattern: "os.Stdout" |
| 26 |
msg: "Direct use of os.Stdout is forbidden. Use a logger instead." |
| 27 |
gomoddirectives: |
| 28 |
toolchain-forbidden: true |
| 29 |
gosec: |
| 30 |
excludes: |
| 31 |
- G101 |
| 32 |
- G117 |
| 33 |
- G703 |
| 34 |
- G704 |
| 35 |
- G705 |
| 36 |
govet: |
| 37 |
enable-all: true |
| 38 |
disable: |
| 39 |
- shadow |
| 40 |
lll: |
| 41 |
line-length: 160 |
| 42 |
revive: |
| 43 |
rules: |
| 44 |
- name: argument-limit |
| 45 |
arguments: |
| 46 |
- 7 |
| 47 |
- name: atomic |
| 48 |
- name: bare-return |
| 49 |
- name: blank-imports |
| 50 |
- name: bool-literal-in-expr |
| 51 |
- name: call-to-gc |
| 52 |
- name: comment-spacings |
| 53 |
arguments: |
| 54 |
- 'nolint:' |
| 55 |
- name: confusing-naming |
| 56 |
- name: constant-logical-expr |
| 57 |
- name: context-as-argument |
| 58 |
- name: context-keys-type |
| 59 |
- name: datarace |
| 60 |
- name: deep-exit |
| 61 |
- name: defer |
| 62 |
- name: dot-imports |
| 63 |
- name: duplicated-imports |
| 64 |
- name: early-return |
| 65 |
- name: empty-block |
| 66 |
- name: empty-lines |
| 67 |
- name: enforce-map-style |
| 68 |
arguments: |
| 69 |
- make |
| 70 |
exclude: |
| 71 |
- TEST |
| 72 |
- name: enforce-repeated-arg-type-style |
| 73 |
arguments: |
| 74 |
- short |
| 75 |
- name: enforce-slice-style |
| 76 |
arguments: |
| 77 |
- make |
| 78 |
- name: error-naming |
| 79 |
- name: error-return |
| 80 |
- name: error-strings |
| 81 |
- name: errorf |
| 82 |
- name: forbidden-call-in-wg-go |
| 83 |
- name: get-return |
| 84 |
- name: identical-branches |
| 85 |
- name: identical-ifelseif-branches |
| 86 |
- name: identical-ifelseif-conditions |
| 87 |
- name: identical-switch-branches |
| 88 |
- name: identical-switch-conditions |
| 89 |
- name: if-return |
| 90 |
- name: import-alias-naming |
| 91 |
- name: import-shadowing |
| 92 |
- name: increment-decrement |
| 93 |
- name: inefficient-map-lookup |
| 94 |
- name: indent-error-flow |
| 95 |
# - name: marshal-receiver |
| 96 |
- name: modifies-parameter |
| 97 |
- name: modifies-value-receiver |
| 98 |
# - name: multiline-if-init |
| 99 |
- name: optimize-operands-order |
| 100 |
- name: package-comments |
| 101 |
- name: package-directory-mismatch |
| 102 |
- name: package-naming |
| 103 |
disabled: true |
| 104 |
- name: range |
| 105 |
- name: range-val-address |
| 106 |
- name: range-val-in-closure |
| 107 |
- name: receiver-naming |
| 108 |
- name: redefines-builtin-id |
| 109 |
- name: redundant-build-tag |
| 110 |
# - name: redundant-canonical-import |
| 111 |
- name: redundant-import-alias |
| 112 |
- name: string-format |
| 113 |
arguments: |
| 114 |
- - fmt.Errorf[0],errors.New[0] |
| 115 |
- /^([^A-Z]|$)/ |
| 116 |
- Error string must not start with a capital letter. |
| 117 |
- - fmt.Errorf[0],errors.New[0] |
| 118 |
- /(^|[^\.!?])$/ |
| 119 |
- Error string must not end in punctuation. |
| 120 |
- - panic |
| 121 |
- /^[^\n]*$/ |
| 122 |
- Must not contain line breaks. |
| 123 |
- name: string-of-int |
| 124 |
- name: struct-tag |
| 125 |
- name: superfluous-else |
| 126 |
- name: time-date |
| 127 |
- name: time-equal |
| 128 |
- name: time-naming |
| 129 |
- name: unchecked-type-assertion |
| 130 |
- name: unconditional-recursion |
| 131 |
- name: unexported-naming |
| 132 |
- name: unnecessary-if |
| 133 |
- name: unnecessary-format |
| 134 |
- name: unnecessary-stmt |
| 135 |
- name: unreachable-code |
| 136 |
- name: unused-parameter |
| 137 |
- name: use-any |
| 138 |
- name: use-errors-new |
| 139 |
- name: use-slices-sort |
| 140 |
- name: use-waitgroup-go |
| 141 |
- name: useless-break |
| 142 |
- name: useless-fallthrough |
| 143 |
- name: var-declaration |
| 144 |
- name: var-naming |
| 145 |
arguments: |
| 146 |
- [] # AllowList - do not remove as args for the rule are positional and won't work without lists first |
| 147 |
- [] # DenyList |
| 148 |
- - skip-package-name-checks: true |
| 149 |
- name: waitgroup-by-value |
| 150 |
sloglint: |
| 151 |
no-mixed-args: true |
| 152 |
kv-only: false |
| 153 |
attr-only: true |
| 154 |
no-global: all |
| 155 |
context: scope |
| 156 |
static-msg: false |
| 157 |
no-raw-keys: false |
| 158 |
key-naming-case: snake |
| 159 |
forbidden-keys: |
| 160 |
- time |
| 161 |
- level |
| 162 |
- msg |
| 163 |
- source |
| 164 |
args-on-sep-lines: true |
| 165 |
tagliatelle: |
| 166 |
case: |
| 167 |
rules: |
| 168 |
yaml: kebab |
| 169 |
json: kebab |
| 170 |
koanf: kebab |
| 171 |
varnamelen: |
| 172 |
ignore-names: |
| 173 |
- tc |
| 174 |
ignore-decls: |
| 175 |
- i int |
| 176 |
- a ...any |
| 177 |
- err error |
| 178 |
- ok bool |
| 179 |
- w http.ResponseWriter |
| 180 |
- r *http.Request |
| 181 |
- rt http.RoundTripper |
| 182 |
- l net.Listener |
| 183 |
- t reflect.Type |
| 184 |
- wg sync.WaitGroup |
| 185 |
- wg *sync.WaitGroup |
| 186 |
- sb strings.Builder |
| 187 |
- mu sync.Mutex |
| 188 |
exclusions: |
| 189 |
generated: lax |
| 190 |
presets: |
| 191 |
- comments |
| 192 |
- common-false-positives |
| 193 |
- legacy |
| 194 |
- std-error-handling |
| 195 |
rules: |
| 196 |
- linters: |
| 197 |
- contextcheck |
| 198 |
- cyclop |
| 199 |
- dogsled |
| 200 |
- dupl |
| 201 |
- dupword |
| 202 |
- funlen |
| 203 |
- gocognit |
| 204 |
- gocyclo |
| 205 |
- lll |
| 206 |
- maintidx |
| 207 |
- goconst |
| 208 |
- wrapcheck |
| 209 |
- gosmopolitan |
| 210 |
path: _test\.go |
| 211 |
- path: _test\.go |
| 212 |
text: "fieldalignment:" |
| 213 |
- path: lib/ |
| 214 |
text: "^underef: could simplify.*cgo.Handle" |
| 215 |
- path: lib/ |
| 216 |
linters: |
| 217 |
- goconst |
| 218 |
- unused |
| 219 |
- path: lib/ |
| 220 |
text: "fieldalignment:" |
| 221 |
- path: lib/ |
| 222 |
text: "missing cases in switch of type management.ClientAuth:" |
| 223 |
- path: internal/ |
| 224 |
text: 'directive `//nolint:revive // HttpClient is required by the upstream rp.RelyingParty interface.` is unused for linter "revive"' |
| 225 |
- path: internal/ |
| 226 |
text: 'directive `//nolint:revive // Required by rp.RelyingParty.` is unused for linter "revive"' |