-
Notifications
You must be signed in to change notification settings - Fork 70
/
.golangci.yml
112 lines (105 loc) · 3 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
run:
issues-exit-code: 1
modules-download-mode: readonly
linters:
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- stylecheck
- typecheck
- unused
- varcheck
- errorlint
- gofumpt
- goimports
- godox
- goheader
- ifshort
- misspell
- prealloc
- unconvert
- revive
fast: false
linters-settings:
goimports:
local-prefixes: github.com/elastic/go-libaudit
gofumpt:
extra-rules: true
goheader:
# Use https://github.com/elastic/go-licenser to automatically add headers.
template: |-
Licensed to Elasticsearch B.V. under one or more contributor
license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright
ownership. Elasticsearch B.V. licenses this file to you under
the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
revive:
enable-all-rules: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
rules:
- name: bare-return
- name: call-to-gc
- name: confusing-results
- name: constant-logical-expr
- name: context-as-argument
- name: deep-exit
- name: defer
- name: duplicated-imports
- name: early-return
- name: empty-block
- name: error-strings
- name: errorf
- name: exported
arguments:
- checkPrivateReceivers
- name: imports-blacklist
arguments:
- github.com/pkg/errors
- name: increment-decrement
- name: range
- name: range-val-address
- name: range-val-in-closure
- name: receiver-naming
- name: struct-tag
- name: time-naming
- name: unconditional-recursion
- name: unexported-naming
- name: unexported-return
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
- name: unused-receiver
- name: var-declaration
- name: waitgroup-by-value
stylecheck:
checks:
- all
- -ST1001 # ST1001 - Dot imports are discouraged
issues:
include:
# If you're going to write a comment follow the conventions.
# https://go.dev/doc/effective_go#commentary.
# comment on exported (.+) should be of the form "(.+)..."
- EXC0014
exclude-rules:
# Ignore output Write/WriteString error checks in tests.
- path: '(.+)_test\.go'
linters:
- errcheck
text: 'out[\w.]+Write'