-
-
Notifications
You must be signed in to change notification settings - Fork 165
/
.golangci.yml
118 lines (118 loc) · 2.81 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
linters:
enable-all: true
disable:
- gofumpt # Prefer `gofmt` rules / some rules conflict with `wsl`
- gomnd # XXX: For now
- spancheck # Calling End() is implemented as expected
# I disagree with the rationale behind these linters
- err113
- depguard
- musttag
- nonamedreturns
# The following are deprecated linters, added to avoid initial warning when running
- execinquery
- exportloopref
# -
- mnd # Magic number
linters-settings:
lll:
line-length: 130
gci:
sections:
- standard
- default
- prefix(github.com/MarioCarrion/todo-api)
section-separators:
- newLine
exhaustruct:
include:
- 'github.com/MarioCarrion/todo-api/internal.*Params'
ireturn:
allow:
- error
- stdlib
#
- 'go.opentelemetry.io/otel/trace.Span'
varnamelen:
max-distance: 10
ignore-type-assert-ok: true
ignore-map-index-ok: true
ignore-chan-recv-ok: true
ignore-decls:
- b bytes.Buffer
- h http.Handler
- id string
- ok bool
- r *http.Request
- w http.ResponseWriter
wrapcheck:
ignoreSigs:
- internaldomain.WrapErrorf(
- internaldomain.NewErrorf(
- internal.NewErrorf(
- internal.WrapErrorf(
ignorePackageGlobs:
- github.com/MarioCarrion/todo-api/*
gosec:
excludes:
- G601 # "Implicit memory aliasing in for loop." Fixed in Go 1.22
issues:
exclude-rules:
# All tests
- path: _test\.go
linters:
- cyclop
- errchkjson
- exhaustruct
- funlen
- goerr113
- lll
- nonamedreturns
- nosnakecase
- varnamelen
- wrapcheck
# Handles the C4 diagrams
- path: internal/doc/doc.go
linters:
- lll
- revive
- stylecheck
# Generates OpenAPI 3 documentation
- path: internal/rest/open_api.go
linters:
- funlen
# Final binaries
- path: cmd/
linters:
- cyclop
- funlen
- gocognit
- unparam
# Handles generating code from OpenAPI 3
- path: cmd/openapi-gen/main.go
linters:
- forbidigo
- path: cmd/internal/postgresql.go
linters:
- revive # blank-imports
# XXX: This will be reremove in future episodes when "exhaustruct" is enabled
- path: internal/postgresql/task.go
linters:
- lll
- path: internal/memcached/task.go
linters:
- lll
# Because of the env var testing and using t.Setenv
- path: internal/envvar/envvar_test.go
linters:
- paralleltest
- thelper
- tparallel
# Because these are tools
- path: internal/tools/tools.go
linters:
- typecheck
# Because go:generate
- path: internal/rest/open_api.go
linters:
- lll