-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
84 lines (77 loc) · 2.51 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
# Refer to golangci-lint's example config file for more options and information:
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
timeout: 5m
modules-download-mode: readonly
go: '1.18'
skip-dirs:
- ent
linters:
enable:
- wsl
- typecheck
- unused
- structcheck
- varcheck
- staticcheck
- ineffassign
- govet
- gosimple
- errcheck
- deadcode
- goimports
- revive
- govet
- staticcheck
- exhaustruct # Checks if all structure fields are initialized
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
- gofumpt
- ifshort # Checks that your code uses short syntax for if-statements whenever possible
- ireturn # Accept Interfaces, Return Concrete Types
- makezero # Finds slice declarations with non-zero initial length
- unparam # Reports unused function parameters
- wrapcheck # Checks that errors returned from external packages are wrapped
- exhaustive # Check exhaustiveness of enum switch statements
- depguard # Go linter that checks if package imports are in a list of acceptable packages
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
linters-settings:
revive:
rules:
- name: exported
disabled: true
exhaustruct:
exclude:
- 'cobra\.Command$'
- 'gen\.Config$'
- 'service$'
wrapcheck:
ignoreSigs:
- .Errorf(
- errors.New(
- errors.Unwrap(
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
- .ErrRollback(
# An array of strings which specify regular expressions of signatures to ignore.
# This is similar to the ignoreSigs configuration above, but gives slightly more
# flexibility.
ignoreSigRegexps:
- \.New.*Error\(
# An array of glob patterns which, if any match the package of the function
# returning the error, will skip wrapcheck analysis for this error. This is
# useful for broadly ignoring packages and/or subpackages from wrapcheck
# analysis. There are no defaults for this value.
ignorePackageGlobs:
- encoding/*
- github.com/pkg/*
# ignoreInterfaceRegexps defines a list of regular expressions which, if matched
# to a underlying interface name, will ignore unwrapped errors returned from a
# function whose call is defined on the given interface.
ignoreInterfaceRegexps:
- ^(?i)c(?-i)ach(ing|e)