forked from stellar/stellar-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
125 lines (114 loc) · 3.82 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
linters-settings:
dupl:
threshold: 100
funlen:
lines: 100
statements: 50
misspell:
locale: US
gci:
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/stellar/) # Custom section: groups all imports with the specified Prefix.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
skip-generated: false
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
dogsled:
# Checks assignments with too many blank identifiers.
# Default: 2
max-blank-identifiers: 3
cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 15
wrapcheck:
# An array of strings that specify substrings of signatures to ignore.
# If this set, it will override the default set of ignored signatures.
# See https://github.com/tomarrell/wrapcheck#configuration for more information.
# Default: [".Errorf(", "errors.New(", "errors.Unwrap(", "errors.Join(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("]
ignoreSigs:
- .Errorf(
- errors.New(
- errors.Unwrap(
- errors.Join(
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
# An array of strings that specify regular expressions of signatures to ignore.
# Default: []
ignoreSigRegexps:
- \.New.*Error\(
# An array of strings that specify globs of packages to ignore.
# Default: []
ignorePackageGlobs:
- encoding/*
- github.com/pkg/*
- github.com/stellar/*
# An array of strings that specify regular expressions of interfaces to ignore.
# Default: []
ignoreInterfaceRegexps:
- ^(?i)c(?-i)ach(ing|e)
testifylint:
enable-all: true
disable:
# TODO: try to enable it
- go-require
forbidigo:
# Forbid the following identifiers (list of regexp).
# Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
forbid:
- p: "^(fmt\\.Print(|f|ln)|print|println)$"
msg: Do not commit debug print statements (in tests use t.Log()).
- p: "^.*$"
pkg: "^github.com/stellar/go/support/errors$"
msg: Do not use stellar/go/support/errors, use the standard 'errors' package and fmt.Errorf().
exclude-godoc-examples: false
analyze-types: true
linters:
enable-all: true
disable:
# deprecated:
- gomnd
- execinquery
- depguard
- nlreturn
- godox
# exhaustruct: enforcing exhaustive fields is useful in some cases, but there are
# too many legitimate default field values in Go
- exhaustruct
# err113: Enforcing errors.Is() is useful but cannot be enabled in isolation
- err113
- thelper
- wsl
- wrapcheck
- testpackage
# TODO: varnamelen: I didn't manage to make it accept short parameter names
- varnamelen
# TODO: ireturn: consider enabling it later on
- ireturn
- godot
- paralleltest
presets: [ ]
fast: false
issues:
# Exclude certain checks in test files
exclude-rules:
- path: '^(.*_test\.go|cmd/stellar-rpc/internal/integrationtest/infrastructure/.*)$'
linters:
- mnd
- gosec
- gochecknoglobals
- nosprintfhostport
run:
timeout: 10m