forked from algorand/go-algorand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
126 lines (116 loc) · 5.45 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
120
121
122
123
124
125
126
run:
timeout: 5m
tests: true
linters:
# default: deadcode, errcheck, gosimple, govet, ineffassign, staticcheck, typecheck, unused, varcheck
disable-all: true
enable:
- errcheck
- gofmt
- gosimple
- govet
- ineffassign
- misspell
- nolintlint
- revive
- staticcheck
- typecheck
severity:
default-severity: error
linters-settings:
nolintlint:
# require naming a specific linter X using //nolint:X
require-specific: true
# require comments like "//nolint:errcheck // Explanation of why we are ignoring linter here..."
require-explanation: true
errcheck:
exclude-functions:
# data/transactions/logic/assembler.go uses ops.error, warn, to append log messages: OK to ignore for this case
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).errorf
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).error
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).warnf
- (*github.com/algorand/go-algorand/data/transactions/logic.OpStream).warn
# We do this 121 times and never check the error.
- (*github.com/spf13/cobra.Command).MarkFlagRequired
govet:
settings:
printf:
# Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`).
# Default: []
funcs:
- (github.com/algorand/go-algorand/logging.Logger).Debugf
- (github.com/algorand/go-algorand/logging.Logger).Infof
- (github.com/algorand/go-algorand/logging.Logger).Warnf
- (github.com/algorand/go-algorand/logging.Logger).Errorf
- (github.com/algorand/go-algorand/logging.Logger).Fatalf
- (github.com/algorand/go-algorand/logging.Logger).Panicf
- (github.com/algorand/go-algorand/logging.Logger).Debugln
- (github.com/algorand/go-algorand/logging.Logger).Infoln
- (github.com/algorand/go-algorand/logging.Logger).Warnln
- (github.com/algorand/go-algorand/logging.Logger).Errorln
- (github.com/algorand/go-algorand/logging.Logger).Fatalln
- (github.com/algorand/go-algorand/logging.Logger).Panicln
- (github.com/algorand/go-algorand/logging.Logger).Debug
- (github.com/algorand/go-algorand/logging.Logger).Info
- (github.com/algorand/go-algorand/logging.Logger).Warn
- (github.com/algorand/go-algorand/logging.Logger).Error
- (github.com/algorand/go-algorand/logging.Logger).Fatal
- (github.com/algorand/go-algorand/logging.Logger).Panic
- (github.com/algorand/go-algorand/data/transactions/logic.OpStream).warnf
- (github.com/algorand/go-algorand/data/transactions/logic.OpStream).errorf
- (github.com/algorand/go-algorand/data/transactions/logic.OpStream).lineErrorf
- (github.com/algorand/go-algorand/cmd/goal/main).reportInfof
- (github.com/algorand/go-algorand/cmd/goal/main).reportInfoln
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnf
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnln
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnRawf
- (github.com/algorand/go-algorand/cmd/goal/main).reportWarnRawln
- (github.com/algorand/go-algorand/cmd/goal/main).reportErrorf
- (github.com/algorand/go-algorand/cmd/goal/main).reportErrorln
issues:
# Work our way back over time to be clean against all these
# checkers. If you'd like to contribute, raise the number after ~,
# run the linter and dig in.
new-from-rev: eb019291beed556ec6ac1ceb4a15114ce4df0c57~25
# Disable default exclude rules listed in `golangci-lint run --help` (selectively re-enable some below)
exclude-use-default: false
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
exclude:
# ignore govet false positive fixed in https://github.com/golang/go/issues/45043
- "sigchanyzer: misuse of unbuffered os.Signal channel as argument to signal.Notify"
# ignore golint false positive fixed in https://github.com/golang/lint/pull/487
- "exported method (.*).Unwrap` should have comment or be unexported"
# ignore issues about the way we use _struct fields to define encoding settings
- "`_struct` is unused"
# Enable some golangci-lint default exception rules:
# "EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok"
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
# "EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore"
- ineffective break statement. Did you mean to break out of the outer loop
# revive: irrelevant error about naming
- "var-naming: don't use leading k in Go names"
exclude-rules:
- path: _test\.go
linters:
- errcheck
# - gofmt
- gosimple
# - govet
- ineffassign
- misspell
- nolintlint
# - revive
- staticcheck
- typecheck
# Add all linters here -- Comment this block out for testing linters
- path: test/linttest/lintissues\.go
linters:
- errcheck
- gofmt
- revive
- govet
- ineffassign
- misspell