forked from TencentBlueKing/bkmonitor-datalink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
99 lines (91 loc) · 2.95 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
# Tencent is pleased to support the open source community by making
# 蓝鲸智云 - 监控平台 (BlueKing - Monitor) available.
# Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://opensource.org/licenses/MIT
# 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.
# 完整版本在 https://golangci-lint.run/usage/configuration/
linters-settings:
funlen:
lines: 80
statements: 80
goconst:
min-len: 3
min-occurrences: 3
gocyclo:
min-complexity: 40
revive:
confidence: 0
rules:
- name: var-declaration
- name: package-comments
- name: dot-imports
- name: blank-imports
- name: exported
- name: var-naming
- name: indent-error-flow
- name: range
- name: errorf
- name: error-naming
- name: error-strings
- name: receiver-naming
- name: increment-decrement
- name: error-return
- name: unexported-return
- name: time-naming
- name: context-keys-type
- name: context-as-argument
govet:
check-shadowing: true
lll:
line-length: 120
errcheck:
check-type-assertions: true
gocritic:
enabled-checks:
- nestingReduce
- commentFormatting
settings:
nestingReduce:
bodyWidth: 5
linters:
disable-all: true
enable:
- goconst
- gocyclo
- gofmt
- ineffassign
- staticcheck
- typecheck
- goimports
- gosimple
- unused
- gocritic
run:
timeout: 20m
skip-files:
- ".*_test\\.go$"
issues:
exclude-use-default: true
# The list of ids of default excludes to include or disable. By default it's empty.
include:
- EXC0004 # govet (possible misuse of unsafe.Pointer|should have signature)
- EXC0005 # staticcheck ineffective break statement. Did you mean to break out of the outer loop
- EXC0012 # revive exported (method|function|type|const) (.+) should have comment or be unexported
- EXC0013 # revive package comment should be of the form "(.+)...
- EXC0014 # revive comment on exported (.+) should be of the form "(.+)..."
- EXC0015 # revive should have a package comment, unless it's in another file for this package
exclude-rules:
- linters:
- staticcheck
text: "SA6002: argument should be pointer-like to avoid allocations" # sync.pool.Put(buf), slice `var buf []byte` will tiger this
- linters:
- lll
source: "^//go:generate " # Exclude lll issues for long lines with go:generate
max-same-issues: 0
new: false
max-issues-per-linter: 0
output:
sort-results: true