-
Notifications
You must be signed in to change notification settings - Fork 466
Expand file tree
/
Copy path.golangci.yml
More file actions
89 lines (88 loc) · 2.82 KB
/
.golangci.yml
File metadata and controls
89 lines (88 loc) · 2.82 KB
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
# golangci-lint configuration used for CI
version: "2"
run:
tests: true
timeout: 15m
linters:
default: none
enable:
- gosec
- govet
- loggercheck
- misspell
- revive
- staticcheck
- unused
settings:
gosec:
excludes:
# At the time of writing this, the G115 rule is not even part of an
# official release of gosec. This rule causes a lot of errors to be
# reported in the codebase. While some of the reported errors should be
# addressed, a lot can also be ignored and there are also some clear false
# positives that should not be flagged by gosec in the first place (see
# https://github.com/securego/gosec/issues/1187). We will re-enable this
# rule in the future when it becomes more accurate.
- G115 # Potential integer overflow when converting between integer types
misspell:
ignore-rules:
- creater
revive:
confidence: 0.8
severity: warning
rules:
- name: unreachable-code
- name: errorf
- name: range
- name: superfluous-else
- name: var-declaration
- name: duplicated-imports
exclusions:
presets:
- legacy
- common-false-positives
paths:
- ^third_party/.*
rules:
- linters:
- staticcheck
# ST1005: error strings must be capitalized
# QF1008: unneccessary use of embedded struct name before field e.g:
# ClusterNetworkPolicy.Metadata.Name vs ClusterNetworkPolicy.Name
text: "(ST1005:|QF1008:)"
- linters:
- staticcheck
text: "SA1019: (v1|corev1).Endpoints is deprecated"
- linters:
- staticcheck
text: "SA1019: (v1|corev1).EndpointSubset is deprecated"
- linters:
- staticcheck
# NewSimpleClientset is marked as deprecated, with the documentation
# suggesting NewClientset as a direct replacement. However, NewClientset
# is only available when apply configurations are generated (e.g. via
# --with-applyconfig), which is not the case for the clientsets
# generated for Antrea CRDs.
# SA1019
text: "NewSimpleClientset is deprecated"
- linters:
- gosec
# G117 warns about potential serialization of secrets as exported struct fields.
# We are currently getting some false positives because of https://github.com/securego/gosec/issues/1527.
# We can eventually enable this rule, but we have several locations
# where we intentionally serialize secrets, e.g., in pkg/apis/controlplane.
text: "G117:"
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- antrea.io/antrea/v2
exclusions:
paths:
- ^third_party/.*
issues:
max-issues-per-linter: 0
max-same-issues: 0