This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
.golangci.yaml
64 lines (59 loc) · 2.15 KB
/
.golangci.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
# This is for the IDE. We need to duplicate it because the --fast flag doesn’t filter manually enabled linters:
# https://github.com/golangci/golangci-lint/issues/1909.
# The idea was then to duplicate it, rename to -ide.yaml and reference this file in settings.json. That way, default
# manualy golangci-lint run would run all linters as CI. IDE will only run our fast list.
# However, we can’t use variables like ${workspaceRoot} in settings.json. https://github.com/microsoft/vscode/issues/2809.
# Please keep the list in sync.
linters:
fast: true
# linters to run in addition to default ones
enable:
- dupl
#- durationcheck
#- errname
#- errorlint
#- exportloopref
- forbidigo
- forcetypeassert
- gci
- godot
- gofmt
#- gosec
- ifshort
- misspell
- revive
#- thelper
#- tparallel
#- unconvert
#- unparam
#- wastedassign
#- whitespace
##- wrapcheck # To think properly about it
# 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
- 'unexported-return: exported func InitialModel(ForTests|WithPrevConfig)? returns unexported type watchdtui.model, which can be annoying to use'
fix: true # we want this in IDE.
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"