-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yaml
More file actions
144 lines (144 loc) · 3.87 KB
/
.golangci.yaml
File metadata and controls
144 lines (144 loc) · 3.87 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
version: "2"
linters:
default: none
enable: # please keep this alphabetized
- errorlint
- goheader
- govet
- ineffassign
- misspell
- nakedret
- revive
- staticcheck
- testifylint
- thelper
- unconvert # Remove unnecessary type conversions
- unparam
- unused
- usestdlibvars
- usetesting
- whitespace
settings:
goheader:
values:
regexp:
ORIGINAL_YEAR: 20[1-2][0-9]
template: |-
Copyright (c) {{ORIGINAL_YEAR}} Broadcom. All Rights Reserved.
Broadcom Confidential. The term "Broadcom" refers to Broadcom Inc.
and/or its subsidiaries.
govet:
enable:
- shadow
nakedret:
# Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10
max-func-lines: 5
revive:
confidence: 0.8
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: early-return
arguments:
- preserveScope
- name: error-return
- name: error-naming
- name: error-strings
- name: errorf
- name: if-return
- name: increment-decrement
- name: indent-error-flow
- name: package-comments
- name: range
- name: receiver-naming
- name: superfluous-else
arguments:
- preserveScope
- name: time-naming
- name: unnecessary-stmt
- name: use-any
- name: var-declaration
- name: var-naming
- name: exported
disabled: true
- name: unexported-return
disabled: true
staticcheck:
checks:
- all
- -SA1019 # TODO(fix) Using a deprecated function, variable, constant or field
- -SA2002 # TODO(fix) Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
- -QF1001 # TODO(fix) Apply De Morgan’s law
- -QF1002 # TODO(fix) Convert untagged switch to tagged switch
- -QF1003 # TODO(fix) Convert if/else-if chain to tagged switch
- -QF1004 # TODO(fix) Use strings.ReplaceAll instead of strings.Replace with n == -1
- -QF1006 # TODO(fix) Lift if+break into loop condition
- -QF1008 # TODO(fix) Omit embedded fields from selector expression
- -QF1009 # TODO(fix) Use time.Time.Equal instead of == operator
- -QF1012 # TODO(fix) Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))
- -ST1003 # TODO(fix) Poorly chosen identifier
- -ST1005 # TODO(fix) Drop unnecessary use of the blank identifier
- ST1019 # Importing the same package multiple times.
thelper:
test:
first: false
begin: false
fuzz:
first: false
begin: false
benchmark:
first: false
begin: false
tb:
first: false
begin: false
usetesting:
os-mkdir-temp: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- ineffassign
path: conversion\.go
- linters:
- staticcheck
text: S1000
- linters:
- revive
text: 'var-naming: avoid meaningless package names'
paths:
- ^zz_generated.*
- third_party$
- builtin$
- examples$
issues:
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- goimports
settings: # please keep this alphabetized
gci:
sections:
- standard
- default
- prefix(github.com/vmware)
goimports:
local-prefixes:
- github.com/vmware # Put imports beginning with prefix after 3rd-party packages.
exclusions:
generated: lax
paths:
- ^zz_generated.*
- third_party$
- builtin$
- examples$