Skip to content

Commit 903b6f5

Browse files
authored
Upgrade to Avalanche v1.11.1 (flare-foundation#55)
1 parent f529e68 commit 903b6f5

File tree

2,329 files changed

+154936
-95927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,329 files changed

+154936
-95927
lines changed

avalanchego/.golangci.yml

Lines changed: 114 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,136 @@
11
# https://golangci-lint.run/usage/configuration/
22
run:
33
timeout: 10m
4-
# skip auto-generated files.
5-
skip-files:
6-
- ".*\\.pb\\.go$"
7-
- ".*mock.*"
4+
5+
# Enables skipping of directories:
6+
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
7+
# Default: true
8+
skip-dirs-use-default: false
9+
10+
# If set we pass it to "go list -mod={option}". From "go help modules":
11+
# If invoked with -mod=readonly, the go command is disallowed from the implicit
12+
# automatic updating of go.mod described above. Instead, it fails when any changes
13+
# to go.mod are needed. This setting is most useful to check that go.mod does
14+
# not need updates, such as in a continuous integration and testing system.
15+
# If invoked with -mod=vendor, the go command assumes that the vendor
16+
# directory holds the correct copies of dependencies and ignores
17+
# the dependency descriptions in go.mod.
18+
#
19+
# Allowed values: readonly|vendor|mod
20+
# By default, it isn't set.
21+
modules-download-mode: readonly
22+
23+
output:
24+
# Make issues output unique by line.
25+
# Default: true
26+
uniq-by-line: false
827

928
issues:
10-
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
29+
# Maximum issues count per one linter.
30+
# Set to 0 to disable.
31+
# Default: 50
32+
max-issues-per-linter: 0
33+
34+
# Maximum count of issues with the same text.
35+
# Set to 0 to disable.
36+
# Default: 3
1137
max-same-issues: 0
1238

1339
linters:
14-
# please, do not use `enable-all`: it's deprecated and will be removed soon.
15-
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
1640
disable-all: true
1741
enable:
1842
- asciicheck
1943
- bodyclose
2044
- depguard
45+
- dupword
2146
- errcheck
47+
- errorlint
2248
- exportloopref
49+
- forbidigo
50+
- gci
2351
- goconst
2452
- gocritic
53+
# - goerr113
2554
- gofmt
2655
- gofumpt
27-
- goimports
56+
# - gomnd
2857
- goprintffuncname
2958
- gosec
3059
- gosimple
3160
- govet
61+
- importas
3262
- ineffassign
63+
# - lll
3364
- misspell
3465
- nakedret
3566
- noctx
3667
- nolintlint
68+
- perfsprint
3769
- prealloc
70+
- predeclared
3871
- revive
72+
- spancheck
3973
- staticcheck
4074
- stylecheck
75+
- tagalign
76+
- testifylint
4177
- typecheck
4278
- unconvert
4379
- unparam
4480
- unused
81+
- usestdlibvars
4582
- whitespace
46-
# - errorlint (TODO: re-enable in go1.20 migration)
47-
# - goerr113
48-
# - gomnd
49-
# - lll
5083

5184
linters-settings:
85+
depguard:
86+
rules:
87+
packages:
88+
deny:
89+
- pkg: "io/ioutil"
90+
desc: io/ioutil is deprecated. Use package io or os instead.
91+
- pkg: "github.com/stretchr/testify/assert"
92+
desc: github.com/stretchr/testify/require should be used instead.
93+
- pkg: "github.com/golang/mock/gomock"
94+
desc: go.uber.org/mock/gomock should be used instead.
5295
errorlint:
5396
# Check for plain type assertions and type switches.
5497
asserts: false
5598
# Check for plain error comparisons.
5699
comparison: false
100+
forbidigo:
101+
# Forbid the following identifiers (list of regexp).
102+
forbid:
103+
- 'require\.Error$(# ErrorIs should be used instead)?'
104+
- 'require\.ErrorContains$(# ErrorIs should be used instead)?'
105+
- 'require\.EqualValues$(# Equal should be used instead)?'
106+
- 'require\.NotEqualValues$(# NotEqual should be used instead)?'
107+
- '^(t|b|tb|f)\.(Fatal|Fatalf|Error|Errorf)$(# the require library should be used instead)?'
108+
# Exclude godoc examples from forbidigo checks.
109+
exclude_godoc_examples: false
110+
gci:
111+
sections:
112+
- standard
113+
- default
114+
- blank
115+
- dot
116+
- prefix(github.com/ava-labs/avalanchego)
117+
- alias
118+
skip-generated: true
119+
custom-order: true
120+
gosec:
121+
excludes:
122+
- G107 # Url provided to HTTP request as taint input https://securego.io/docs/rules/g107
123+
importas:
124+
# Do not allow unaliased imports of aliased packages.
125+
no-unaliased: false
126+
# Do not allow non-required aliases.
127+
no-extra-aliases: false
128+
# List of aliases
129+
alias:
130+
- pkg: github.com/ava-labs/avalanchego/utils/math
131+
alias: safemath
132+
- pkg: github.com/ava-labs/avalanchego/utils/json
133+
alias: avajson
57134
revive:
58135
rules:
59136
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
@@ -96,20 +173,32 @@ linters-settings:
96173
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
97174
- name: useless-break
98175
disabled: false
176+
spancheck:
177+
# https://github.com/jjti/go-spancheck#checks
178+
checks:
179+
- end
180+
# - record-error # check that `span.RecordError(err)` is called when an error is returned
181+
# - set-status # check that `span.SetStatus(codes.Error, msg)` is called when an error is returned
99182
staticcheck:
100-
go: "1.19"
101183
# https://staticcheck.io/docs/options#checks
102184
checks:
103185
- "all"
104-
- "-SA6002" # argument should be pointer-like to avoid allocation, for sync.Pool
105-
- "-SA1019" # deprecated packages e.g., golang.org/x/crypto/ripemd160
106-
# https://golangci-lint.run/usage/linters#gosec
107-
gosec:
108-
excludes:
109-
- G107 # https://securego.io/docs/rules/g107.html
110-
depguard:
111-
list-type: blacklist
112-
packages-with-error-message:
113-
- io/ioutil: 'io/ioutil is deprecated. Use package io or os instead.'
114-
- github.com/stretchr/testify/assert: 'github.com/stretchr/testify/require should be used instead.'
115-
include-go-root: true
186+
- "-SA6002" # Storing non-pointer values in sync.Pool allocates memory
187+
- "-SA1019" # Using a deprecated function, variable, constant or field
188+
tagalign:
189+
align: true
190+
sort: true
191+
strict: true
192+
order:
193+
- serialize
194+
testifylint:
195+
# Enable all checkers (https://github.com/Antonboom/testifylint#checkers).
196+
# Default: false
197+
enable-all: true
198+
# Disable checkers by name
199+
# (in addition to default
200+
# suite-thelper
201+
# ).
202+
disable:
203+
- go-require
204+
- float-compare

avalanchego/.goreleaser.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)