-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
168 lines (143 loc) · 3.86 KB
/
Copy path.golangci.yml
File metadata and controls
168 lines (143 loc) · 3.86 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
version: "2"
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/dotcommander/zai
linters:
disable-all: true
enable:
- ineffassign
- staticcheck
- unused
- govet
- misspell
- depguard
- errcheck
- gosec
- gocritic
- gocyclo
- dupl
- gocognit
- funlen
- nestif
- goconst
- revive
settings:
govet:
enable-all: true
disable:
- fieldalignment
- shadow
gocyclo:
min-complexity: 15
gocognit:
min-complexity: 20
funlen:
lines: 80
statements: 50
nestif:
min-complexity: 4
goconst:
min-len: 3
min-occurrences: 3
ignore-tests: true
dupl:
threshold: 100
gosec:
excludes:
- G104
- G304
- G301
revive:
rules:
- name: exported
disabled: true
- name: unexported-return
- name: indent-error-flow
- name: var-naming
- name: empty-block
- name: unnecessary-stmt
- name: confusing-naming
- name: confusing-results
depguard:
rules:
banned-routers:
deny:
- pkg: github.com/gin-gonic/gin
desc: "Use github.com/go-chi/chi/v5 instead"
- pkg: github.com/gorilla/mux
desc: "Use github.com/go-chi/chi/v5 instead"
banned-logging:
deny:
- pkg: github.com/rs/zerolog
desc: "Use log/slog (standard library) instead"
- pkg: github.com/sirupsen/logrus
desc: "Use log/slog (standard library) instead"
banned-llm:
deny:
- pkg: github.com/sashabaranov/go-openai
desc: "Use github.com/openai/openai-go (v3+) instead"
banned-config:
deny:
- pkg: github.com/knadh/koanf
desc: "Use github.com/spf13/viper instead"
- pkg: github.com/joho/godotenv
desc: "Use github.com/spf13/viper for env loading instead"
- pkg: github.com/kelseyhightower/envconfig
desc: "Use github.com/spf13/viper instead"
- pkg: github.com/caarlos0/env
desc: "Use github.com/spf13/viper instead"
banned-http:
deny:
- pkg: github.com/go-resty/resty
desc: "Use github.com/hashicorp/go-retryablehttp instead"
banned-validation:
deny:
- pkg: github.com/asaskevich/govalidator
desc: "Use github.com/go-playground/validator/v10 instead"
banned-templates:
deny:
- pkg: github.com/flosch/pongo2
desc: "Use github.com/a-h/templ instead"
- pkg: github.com/CloudyKit/jet
desc: "Use github.com/a-h/templ instead"
banned-testing:
deny:
- pkg: gopkg.in/check.v1
desc: "Use github.com/stretchr/testify instead"
- pkg: github.com/smartystreets/goconvey
desc: "Use github.com/stretchr/testify instead"
- pkg: github.com/onsi/ginkgo
desc: "Use github.com/stretchr/testify instead"
banned-errors:
deny:
- pkg: github.com/pkg/errors
desc: "Use fmt.Errorf with %w for error wrapping instead"
banned-yaml:
deny:
- pkg: gopkg.in/yaml.v2
desc: "Use gopkg.in/yaml.v3 instead"
banned-sqlite:
deny:
- pkg: github.com/mattn/go-sqlite3
desc: "Use modernc.org/sqlite (pure Go, no CGO) instead"
run:
timeout: 5m
build-tags: []
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
- path: _test\.go
linters:
- dupl
- goconst
- funlen
- gocognit
- path: cmd/
linters:
- funlen