-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
156 lines (151 loc) · 3.51 KB
/
.golangci.yaml
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
145
146
147
148
149
150
151
152
153
154
155
156
linters:
disable-all: true
enable:
- depguard
- revive
- stylecheck
- gosec
- goconst
- gocyclo
- gci
- unparam
- govet
presets:
- bugs
- comment
- complexity
- error
- format
- import
# - metalinter #slow
- module
- performance
# - sql
- style
- test
- unused
linters-settings:
revive:
ignore-generated-header: true
enable-all-rules: false
# Specifying any rule explicitly will disable the default-enabled rules.
# Manually specify the defaults along with `context-as-argument`.
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
- name: argument-limit
arguments: [4]
- name: bare-return
disabled: false
- name: blank-imports
disabled: false
- name: error-naming
disabled: false
- name: error-return
disabled: false
- name: error-strings
disabled: false
- name: exported
disabled: false
- name: increment-decrement
disabled: false
- name: indent-error-flow
disabled: false
- name: receiver-naming
disabled: false
- name: range
disabled: false
- name: var-naming
disabled: false
stylecheck:
checks: ["all"]
gci:
custom-order: true
sections:
- standard
- default
- prefix(github.com/intility/indev)
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax
deny:
- pkg: io/ioutil
desc: "replaced by io and os packages since Go 1.16"
nlreturn:
block-size: 2
forbidigo:
forbid:
- p: ^fmt\.Print.*$
msg: "reasons"
- p: ^cmd\.Print.*$
msg: "use ux.Fprint(cmd.OutOrStdout(), msg) instead"
varnamelen:
ignore-decls:
- w http.ResponseWriter
- r *http.Request
exhaustruct:
# List of regular expressions to exclude struct packages and their names from checks.
# Regular expressions must match complete canonical struct package/name/structname.
# These packages typically contains no suitable constructors, but needs to be used with zero values.
# Default: []
exclude:
# std libs
- "^net/http.Client$"
- "^net/http.Cookie$"
- "^net/http.Request$"
- "^net/http.Response$"
- "^net/http.Server$"
- "^net/http.Transport$"
# 3rd party
- ".+/cobra.Command$"
- ".+openai.ChatCompletionRequest"
- ".+openai.ChatCompletionMessage"
issues:
exclude-dirs:
- bin
- vendor
- .codecov.yml
- .coveralls.yml
- .git
- .gitattributes
- .github
- .gitignore
- .gitlab
- .gitmodules
- .golangci
- .golangci.yaml
- .goreleaser
- .goreleaser.d
- .goreleaser.yml
- .idea
- .mockery.yaml
- .travis.yml
- .vscode
exclude-rules:
- path: cmd
linters:
- gochecknoinits
- gochecknoglobals
- path: internal/build
linters:
- gochecknoglobals
- path: internal/telemetry
linters:
- gochecknoglobals
- path: internal/pipeline
linters:
- ireturn
- wrapcheck
- path: internal/ux
linters:
- gochecknoglobals
- path: '(.+)\.go$'
linters:
- varnamelen
# pkg/wizard is based on charmbracelet/bubbletea that uses
# interfaces as return values to manage the state machine.
- path: 'internal/wizard/.*\.go$'
linters:
- ireturn
run:
tests: false # skip test files