-
Notifications
You must be signed in to change notification settings - Fork 50
/
.golangci-ci.yaml
65 lines (59 loc) · 2.09 KB
/
.golangci-ci.yaml
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
# This is for the CI. To run it, please use:
# golangci-lint run -c .golangci-ci.yaml.
# Please keep the list in sync with .golangci-ide.yaml. For rationale, see the other file.
linters:
# linters to run in addition to default ones
enable:
- dupl
- durationcheck
- errname
- errorlint
- exportloopref
- forbidigo
- forcetypeassert
- gci
- godot
- gofmt
- gosec
- misspell
- revive
- thelper
- tparallel
- unconvert
- unparam
- wastedassign
- whitespace
##- wrapcheck # To think properly about it
run:
# Most of the time, it’s taking less than 20s, but some builders are slower, so takes 2m
timeout: 2m
# Get all linter issues, even if duplicated
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
exclude:
# EXC0001 errcheck: most errors are in defer calls, which are safe to ignore and idiomatic Go (would be good to only ignore defer ones though)
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv|w\.Stop). is not checked'
# EXC0008 gosec: duplicated of errcheck
- (G104|G307)
# EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
- Potential file inclusion via variable
# revive: unexported-return for functions exported only in tests, aliasing doesn't work here as the linter always goes for the underlying model which is unexported
- 'unexported-return: exported func InitialModel(ForTests|WithPrevConfig)? returns unexported type watchdtui.model, which can be annoying to use'
# Sometimes it is more readable to do a `if err := a(); err != nil` than simply `return a()`
- if-return
#fix: true # we don’t want this in CI
nolintlint:
require-explanation: true
require-specific: true
linters-settings:
# Forbid the usage of deprecated ioutil and debug prints
forbidigo:
forbid:
- ioutil\.
- ^print.*$
staticcheck:
# Should be better for it to be autodetected
# https://github.com/golangci/golangci-lint/issues/2234
go: "1.18"