-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy path.golangci.yml
More file actions
68 lines (66 loc) · 1.81 KB
/
Copy path.golangci.yml
File metadata and controls
68 lines (66 loc) · 1.81 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
version: "2"
linters:
default: none
enable:
- gosec
- govet
- ineffassign
- misspell
- errcheck
- unused
- gocognit
# Detect potential fat context in loops.
# https://github.com/Crocmagnon/fatcontext
- fatcontext
# I tried turning on contextcheck but it has many false positives.
#- contextcheck
# https://github.com/golangci/golangci-lint/pull/2438
# Disable linter that does not work with go1.18
#- staticcheck
#- gosimple
settings:
gosec:
excludes:
- G404 # G404: Use of weak random number generator (math/rand instead of crypto/rand)
# We use errcheck to check unhandled errors.
- G104 # G104: Errors unhandled
- G304 # G304: Potential file inclusion via variable
- G301 # G301: Expect directory permissions to be 0750 or less
- G302 # G302: Expect file permissions to be 0600 or less
govet:
# We want to enable all govet analyzers.
enable-all: true
disable:
# If fieldalignment is enabled, we have many errors because all of our structs are not sorted to minimize memory.
- fieldalignment
# We shadow variables in a lot of places. Enabling this will generate many errors.
- shadow
errcheck:
exclude-functions:
- fmt.Fprintf
- (io.ReadCloser).Close
- (io.Closer).Close
- (*os.File).Close
- (io/fs.File).Close
- os.Remove
- (*database/sql.Rows).Close
- os.Setenv
exclusions:
rules:
- path: pkg/util/databasesqlwrapper
linters:
- gocognit
- path: pkg/lib/saml/samlprotocol/duration.go
linters:
- gocognit
# Exclude errcheck and gosec in test files.
- path: _test\.go
linters:
- errcheck
- gosec
issues:
max-issues-per-linter: 0
formatters:
settings:
gofmt:
simplify: false