Skip to content

Commit 4265edb

Browse files
krebernisakecPablo
authored andcommitted
Bump golangci-lint (#557)
Supports and extracted from #486
1 parent ae0d708 commit 4265edb

File tree

146 files changed

+1148
-971
lines changed

Some content is hidden

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

146 files changed

+1148
-971
lines changed

.github/workflows/pull-request-main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ jobs:
1616
actions: read
1717
steps:
1818
- name: Linting Go
19-
uses: smartcontractkit/.github/actions/ci-lint-go@5ef875a78da521085ad768ecf2ed5e25009496f7 # ci-lint-go@2.0.0
19+
uses: smartcontractkit/.github/actions/ci-lint-go@bd2ca3d8fa2dc89f98b49b297e9b72c2e3e68cdc # ci-lint-go@3.1.0
2020
with:
21-
golangci-lint-version: v2.1.6
21+
golangci-lint-version: v2.6.2
2222
use-go-cache: true
2323
only-new-issues: false
24+
golangci-lint-config: .golangci.yml
2425

2526
ci-lint-e2e:
2627
name: Lint E2E tests
@@ -31,12 +32,13 @@ jobs:
3132
actions: read
3233
steps:
3334
- name: Linting Go
34-
uses: smartcontractkit/.github/actions/ci-lint-go@5ef875a78da521085ad768ecf2ed5e25009496f7 # ci-lint-go@2.0.0
35+
uses: smartcontractkit/.github/actions/ci-lint-go@bd2ca3d8fa2dc89f98b49b297e9b72c2e3e68cdc # ci-lint-go@3.1.0
3536
with:
36-
golangci-lint-version: v2.1.6
37+
golangci-lint-version: v2.6.2
3738
golangci-lint-args: --build-tags="e2e"
3839
use-go-cache: true
3940
only-new-issues: false
41+
golangci-lint-config: .golangci.yml
4042

4143
ci-lint-misc:
4244
name: Lint GH Actions and scripts

.github/workflows/push-main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ jobs:
1515
actions: read
1616
steps:
1717
- name: Linting Go
18-
uses: smartcontractkit/.github/actions/ci-lint-go@5ef875a78da521085ad768ecf2ed5e25009496f7 # ci-lint-go@2.0.0
18+
uses: smartcontractkit/.github/actions/ci-lint-go@bd2ca3d8fa2dc89f98b49b297e9b72c2e3e68cdc # ci-lint-go@3.1.0
1919
with:
20-
golangci-lint-version: v2.1.6
20+
golangci-lint-version: v2.6.2
2121
use-go-cache: true
2222
only-new-issues: false
23+
golangci-lint-config: .golangci.yml
2324

2425
ci-lint-e2e:
2526
name: Lint E2E tests
@@ -30,12 +31,13 @@ jobs:
3031
actions: read
3132
steps:
3233
- name: Linting Go
33-
uses: smartcontractkit/.github/actions/ci-lint-go@5ef875a78da521085ad768ecf2ed5e25009496f7 # ci-lint-go@2.0.0
34+
uses: smartcontractkit/.github/actions/ci-lint-go@bd2ca3d8fa2dc89f98b49b297e9b72c2e3e68cdc # ci-lint-go@3.1.0
3435
with:
35-
golangci-lint-version: v2.1.6
36+
golangci-lint-version: v2.6.2
3637
golangci-lint-args: --build-tags="e2e"
3738
use-go-cache: true
3839
only-new-issues: false
40+
golangci-lint-config: .golangci.yml
3941

4042
ci-lint-misc:
4143
name: Lint GH Actions and scripts

.github/workflows/push-tag-release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ jobs:
1414
actions: read
1515
steps:
1616
- name: ci-lint
17-
uses: smartcontractkit/.github/actions/ci-lint-go@5ef875a78da521085ad768ecf2ed5e25009496f7 # ci-lint-go@2.0.0
17+
uses: smartcontractkit/.github/actions/ci-lint-go@bd2ca3d8fa2dc89f98b49b297e9b72c2e3e68cdc # ci-lint-go@3.1.0
1818
with:
19-
golangci-lint-version: v2.1.6
19+
golangci-lint-version: v2.6.2
20+
golangci-lint-config: .golangci.yml
2021

2122
ci-lint-e2e:
2223
name: Lint E2E tests
@@ -27,10 +28,11 @@ jobs:
2728
actions: read
2829
steps:
2930
- name: Linting Go
30-
uses: smartcontractkit/.github/actions/ci-lint-go@5ef875a78da521085ad768ecf2ed5e25009496f7 # ci-lint-go@2.0.0
31+
uses: smartcontractkit/.github/actions/ci-lint-go@bd2ca3d8fa2dc89f98b49b297e9b72c2e3e68cdc # ci-lint-go@3.1.0
3132
with:
32-
golangci-lint-version: v2.1.6
33+
golangci-lint-version: v2.6.2
3334
golangci-lint-args: --build-tags="e2e"
35+
golangci-lint-config: .golangci.yml
3436

3537
ci-test:
3638
runs-on: ubuntu-latest

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ linters:
4242
settings:
4343
goconst:
4444
min-len: 5
45+
gomoddirectives:
46+
replace-allow-list:
47+
- github.com/gogo/protobuf
4548
govet:
4649
enable:
4750
- shadow

builder_timelock_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/smartcontractkit/mcms/types"
1313
)
1414

15-
func TestTimelockProposalBuilder(t *testing.T) {
15+
func TestTimelockProposal_Builder(t *testing.T) {
1616
t.Parallel()
1717

1818
// Define a fixed validUntil timestamp for consistency

e2e/ledger/ledger_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build e2e
2-
// +build e2e
32

43
package ledger
54

@@ -10,16 +9,10 @@ import (
109
"os"
1110
"testing"
1211

13-
"github.com/ethereum/go-ethereum/accounts"
14-
"github.com/ethereum/go-ethereum/accounts/abi/bind"
15-
"github.com/ethereum/go-ethereum/accounts/usbwallet"
16-
"github.com/ethereum/go-ethereum/common"
17-
gethTypes "github.com/ethereum/go-ethereum/core/types"
18-
"github.com/ethereum/go-ethereum/crypto"
19-
"github.com/gagliardetto/solana-go"
20-
cselectors "github.com/smartcontractkit/chain-selectors"
2112
"github.com/stretchr/testify/suite"
2213

14+
cselectors "github.com/smartcontractkit/chain-selectors"
15+
2316
"github.com/smartcontractkit/mcms"
2417
e2e "github.com/smartcontractkit/mcms/e2e/tests"
2518
solanae2e "github.com/smartcontractkit/mcms/e2e/tests/solana"
@@ -29,6 +22,15 @@ import (
2922
"github.com/smartcontractkit/mcms/sdk/evm/bindings"
3023
solanamcms "github.com/smartcontractkit/mcms/sdk/solana"
3124
"github.com/smartcontractkit/mcms/types"
25+
26+
"github.com/ethereum/go-ethereum/accounts"
27+
"github.com/ethereum/go-ethereum/accounts/abi/bind"
28+
"github.com/ethereum/go-ethereum/accounts/usbwallet"
29+
"github.com/ethereum/go-ethereum/common"
30+
gethTypes "github.com/ethereum/go-ethereum/core/types"
31+
"github.com/ethereum/go-ethereum/crypto"
32+
33+
"github.com/gagliardetto/solana-go"
3234
)
3335

3436
func TestManualLedgerSigningSuite(t *testing.T) {

e2e/tests/aptos/common.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ package aptos
55
import (
66
"time"
77

8-
"github.com/aptos-labs/aptos-go-sdk"
9-
"github.com/aptos-labs/aptos-go-sdk/crypto"
108
"github.com/stretchr/testify/suite"
119

1210
cselectors "github.com/smartcontractkit/chain-selectors"
11+
12+
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
13+
14+
"github.com/aptos-labs/aptos-go-sdk"
15+
"github.com/aptos-labs/aptos-go-sdk/crypto"
16+
1317
"github.com/smartcontractkit/chainlink-aptos/bindings/mcms"
1418
mcmstest "github.com/smartcontractkit/chainlink-aptos/bindings/mcms_test"
15-
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
1619

1720
e2e "github.com/smartcontractkit/mcms/e2e/tests"
1821
"github.com/smartcontractkit/mcms/types"
1922
)
2023

21-
type AptosTestSuite struct {
24+
type TestSuite struct {
2225
suite.Suite
2326
e2e.TestSetup
2427

@@ -29,7 +32,7 @@ type AptosTestSuite struct {
2932
MCMSTestContract mcmstest.MCMSTest
3033
}
3134

32-
func (a *AptosTestSuite) SetupSuite() {
35+
func (a *TestSuite) SetupSuite() {
3336
a.TestSetup = *e2e.InitializeSharedTestSetup(a.T())
3437
details, err := cselectors.GetChainDetailsByChainIDAndFamily(a.AptosChain.ChainID, cselectors.FamilyAptos)
3538
a.Require().NoError(err)
@@ -46,7 +49,7 @@ func (a *AptosTestSuite) SetupSuite() {
4649
a.Require().NoError(err)
4750
}
4851

49-
func (a *AptosTestSuite) deployMCMSContract() {
52+
func (a *TestSuite) deployMCMSContract() {
5053
mcmsSeed := mcms.DefaultSeed + time.Now().String()
5154
addr, tx, mcmsContract, err := mcms.DeployToResourceAccount(a.deployerAccount, a.AptosRPCClient, mcmsSeed)
5255
a.Require().NoError(err)
@@ -57,7 +60,7 @@ func (a *AptosTestSuite) deployMCMSContract() {
5760
a.MCMSContract = mcmsContract
5861
}
5962

60-
func (a *AptosTestSuite) deployMCMSTestContract() {
63+
func (a *TestSuite) deployMCMSTestContract() {
6164
if a.MCMSContract == nil {
6265
a.T().Fatal("MCMS contract not found. Can only deploy MCMS user contract after MCMS contract has been deployed.")
6366
}

e2e/tests/aptos/set_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/smartcontractkit/mcms/types"
1414
)
1515

16-
func (a *AptosTestSuite) Test_Aptos_SetConfig() {
16+
func (a *TestSuite) TestSetConfig() {
1717
/*
1818
This tests setting and retrieving the config for all three timelock roles:
1919
- Bypasser

e2e/tests/aptos/timelock_cancel.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ import (
88
"slices"
99
"time"
1010

11+
"github.com/smartcontractkit/mcms"
12+
"github.com/smartcontractkit/mcms/sdk"
13+
"github.com/smartcontractkit/mcms/types"
14+
1115
"github.com/ethereum/go-ethereum/common"
1216
"github.com/ethereum/go-ethereum/crypto"
17+
1318
"github.com/smartcontractkit/chainlink-aptos/bindings/bind"
1419

15-
"github.com/smartcontractkit/mcms"
16-
"github.com/smartcontractkit/mcms/sdk"
1720
aptossdk "github.com/smartcontractkit/mcms/sdk/aptos"
18-
"github.com/smartcontractkit/mcms/types"
1921
)
2022

21-
func (a *AptosTestSuite) Test_Aptos_TimelockCancel() {
23+
func (a *TestSuite) TestTimelock_Cancel() {
2224
/*
2325
This tests that a timelock proposal scheduled by the Proposer MCM can be cancelled by the
2426
Canceller MCM.
@@ -192,7 +194,7 @@ func (a *AptosTestSuite) Test_Aptos_TimelockCancel() {
192194
var opCount uint64
193195
opCount, err = proposerInspector.GetOpCount(a.T().Context(), mcmsAddress.StringLong())
194196
a.Require().NoError(err)
195-
a.Require().EqualValues(opCount, 1)
197+
a.Require().EqualValues(1, opCount)
196198

197199
timelockExecutor := aptossdk.NewTimelockExecutor(a.AptosRPCClient, a.deployerAccount)
198200
timelockExecutors := map[types.ChainSelector]sdk.TimelockExecutor{

e2e/tests/aptos/timelock_proposal.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ import (
99
"slices"
1010
"time"
1111

12-
"github.com/aptos-labs/aptos-go-sdk/api"
12+
"github.com/stretchr/testify/assert"
13+
14+
"github.com/smartcontractkit/mcms"
15+
"github.com/smartcontractkit/mcms/sdk"
16+
"github.com/smartcontractkit/mcms/types"
17+
1318
"github.com/ethereum/go-ethereum/common"
1419
"github.com/ethereum/go-ethereum/crypto"
20+
21+
"github.com/aptos-labs/aptos-go-sdk/api"
22+
1523
"github.com/smartcontractkit/chainlink-aptos/bindings/bind"
1624
module_mcms_user "github.com/smartcontractkit/chainlink-aptos/bindings/mcms_test/mcms_user"
1725
"github.com/smartcontractkit/chainlink-aptos/relayer/codec"
18-
"github.com/stretchr/testify/assert"
1926

20-
"github.com/smartcontractkit/mcms"
21-
"github.com/smartcontractkit/mcms/sdk"
2227
aptossdk "github.com/smartcontractkit/mcms/sdk/aptos"
23-
"github.com/smartcontractkit/mcms/types"
2428
)
2529

26-
func (a *AptosTestSuite) Test_Aptos_TimelockProposal() {
30+
func (a *TestSuite) TestTimelockProposal() {
2731
/*
2832
This tests that both the Proposers and the Bypassers can successfully perform operations
2933
via the timelock.
@@ -286,6 +290,7 @@ func (a *AptosTestSuite) Test_Aptos_TimelockProposal() {
286290

287291
startingOpCount, errr := inspector.GetOpCount(a.T().Context(), mcmsAddress.StringLong())
288292
a.Require().NoError(errr)
293+
289294
validUntil := uint32(time.Now().Add(time.Hour * 24).Unix())
290295
mcmsTestProposalBuilder := mcms.NewTimelockProposalBuilder().
291296
SetVersion("v1").

0 commit comments

Comments
 (0)