forked from ansible/receptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
119 lines (116 loc) · 3.53 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
119
---
run:
timeout: 10m
linters:
disable-all: true
enable:
- asciicheck
- bodyclose
# - cyclop # TODO: Reduce code complexity.
- depguard
- dogsled
# - dupl # TODO: Remove duplicates.
- durationcheck
# - errcheck # TODO: Not all received errors are checked.
# - errorlint # TODO: Use errors package.
- exportloopref
# - forcetypeassert # TODO: always assert types when when casting.
# - funlen # TODO: Reduce code complexity.
- gci
# - gochecknoglobals # TODO: Reduce number of globals.
# - gochecknoinits # TODO: Maybe not use init().
# - gocognit # TODO: Reduce code complexity.
- gocritic
# - gocyclo # TODO: Reduce code complexity.
- godot
# - goerr113 # TODO: Please do not use dynamic errors.
- gofmt
- gofumpt
- goheader
- goimports
# - golint # Deprecated.
- gomoddirectives
- gomodguard
# - goprintffuncname # TODO: logging methods are not named like the ones in `fmt` which could lead to problems.
- gosec
- gosimple
- govet
- importas
- ineffassign
- makezero
- misspell
- nakedret
# - nestif # TODO: Reduce code complexity.
- nilerr
- nlreturn
- noctx
- nolintlint
# - paralleltest # TODO: missing at some locations
- prealloc
- predeclared
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
# - testpackage # TODO: Put tests in their dedicated test packages.
# - thelper # TODO: Requires test refactoring.
- tparallel
- typecheck
- unconvert
# - unparam # TODO: This breaks something, look at it!
- unused
- wastedassign
- whitespace
# - wrapcheck # TODO: Errors passed upwards should be wrapped.
linters-settings:
depguard:
rules:
main:
files:
- "$all"
- "!$test"
- "!**/functional/**/*.go"
allow:
- "$gostd"
- "github.com/ansible/receptor/internal/version"
- "github.com/ansible/receptor/pkg"
- "github.com/creack/pty"
- "github.com/fsnotify/fsnotify"
- "github.com/ghjm/cmdline"
- "github.com/golang-jwt/jwt/v4"
- "github.com/google/shlex"
- "github.com/gorilla/websocket"
- "github.com/jupp0r/go-priority-queue"
- "github.com/minio/highwayhash"
- "github.com/pbnjay/memory"
- "github.com/quic-go/quic-go"
- "github.com/rogpeppe/go-internal/lockedfile"
- "github.com/songgao/water"
- "github.com/vishvananda/netlink"
- "k8s.io/api/core"
- "k8s.io/apimachinery/pkg"
- "k8s.io/client-go"
tests:
files:
- "$test"
- "**/functional/**/*.go"
allow:
- "$gostd"
- "github.com/ansible/receptor/pkg"
- "github.com/ansible/receptor/tests/utils"
- "github.com/fortytw2/leaktest"
- "github.com/gorilla/websocket"
- "github.com/golang/mock/gomock"
- "github.com/prep/socketpair"
issues:
# Dont commit the following line.
# It will make CI pass without telling you about errors.
# fix: true
exclude:
- "lostcancel" # TODO: Context is not canceled on multiple occasions. Needs more detailed work to be fixed.
- "SA2002|thelper|testinggoroutine" # TODO: Test interface used outside of its routine, tests need to be rewritten.
- "G306" # TODO: Restrict perms of touched files.
- "G402|G404" # TODO: Make TLS more secure.
- "G204" # gosec is throwing a fit, ignore.
...