-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy path.golangci.yml
More file actions
77 lines (72 loc) · 1.77 KB
/
.golangci.yml
File metadata and controls
77 lines (72 loc) · 1.77 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
version: "2"
formatters:
enable:
- gofmt
- gci
settings:
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
gci:
sections:
- standard
- default
- prefix(go.opentelemetry.io/obi)
- prefix(github.com/grafana)
- localmodule
run:
build-tags:
- integration
linters:
exclusions:
paths:
- ^configs
- ^docs
- ^.obi-src
- ^vendor
- ^internal/test/beyla_extensions # Beyla-specific tests, copied to generated OBI tests by generate-obi-tests.sh
- ^internal/testgenerated/ # Generated OBI tests, not in git
presets:
- std-error-handling
# Log a warning if an exclusion rule is unused.
warn-unused: true
rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gocyclo
- cyclop
# revive returns false indent-error-flow errors in some cases where
# an "else" clause is required to access the if condition context
- path: .*
linters:
- revive
text: indent-error-flow
# exclude deprecated API usage errors. If we deprecate some properties is because we don't want to remove them
# (hide/undocument them, but keep supporting them until the next major version)
- path: .*
linters:
- staticcheck
text: "SA1019:"
enable:
- errcheck
- errorlint
- cyclop
- errname
- gocritic
- govet
- ineffassign
# - revive TODO: re-add
- staticcheck
- unused
disable:
- exhaustive
settings:
gocritic:
enabled-checks:
- rangeExprCopy
- rangeValCopy
- indexAlloc
- commentedOutCode
cyclop:
max-complexity: 12