Skip to content

Commit

Permalink
bump golangci-lint to v1.59.1 (#13598)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Jun 18, 2024
1 parent e56d5d6 commit 1d75e3e
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/actions/golangci-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ runs:
- name: golangci-lint
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: v1.55.2
version: v1.59.1
# We already cache these directories in setup-go
skip-pkg-cache: true
skip-build-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
- name: Lint Go
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: v1.55.2
version: v1.59.1
# We already cache these directories in setup-go
skip-pkg-cache: true
skip-build-cache: true
Expand Down
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ linters:
- depguard
- whitespace
- containedctx
- fatcontext
- mirror
linters-settings:
exhaustive:
default-signifies-exhaustive: true
Expand All @@ -31,8 +33,8 @@ linters-settings:
# - G304
# - G404
govet:
# report about shadowed variables
check-shadowing: true
enable:
- shadow
settings:
printf:
# Additionally check chainlink custom loggers
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pnpm 8.15.8
postgres 15.1
helm 3.10.3
zig 0.11.0
golangci-lint 1.55.2
golangci-lint 1.59.1
protoc 25.1
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ config-docs: ## Generate core node configuration documentation
.PHONY: golangci-lint
golangci-lint: ## Run golangci-lint for all issues.
[ -d "./golangci-lint" ] || mkdir ./golangci-lint && \
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v1.56.2 golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 > ./golangci-lint/$(shell date +%Y-%m-%d_%H:%M:%S).txt
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v1.59.1 golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 > ./golangci-lint/$(shell date +%Y-%m-%d_%H:%M:%S).txt


GORELEASER_CONFIG ?= .goreleaser.yaml
Expand Down
7 changes: 4 additions & 3 deletions core/utils/deferable_write_closer_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package utils

import (
"io"
"os"
"path/filepath"
"testing"
Expand All @@ -16,7 +17,7 @@ func TestDeferableWriteCloser_Close(t *testing.T) {

wc := NewDeferableWriteCloser(f)
wantStr := "wanted"
_, err = wc.Write([]byte(wantStr))
_, err = io.WriteString(wc, wantStr)
assert.NoError(t, err)
defer func() {
assert.NoError(t, wc.Close())
Expand All @@ -27,10 +28,10 @@ func TestDeferableWriteCloser_Close(t *testing.T) {
// safe to close multiple times
assert.NoError(t, wc.Close())

_, err = f.Write([]byte("after close"))
_, err = io.WriteString(f, "after close")
assert.ErrorIs(t, err, os.ErrClosed)

_, err = wc.Write([]byte("write to wc after close"))
_, err = io.WriteString(f, "write to wc after close")
assert.ErrorIs(t, err, os.ErrClosed)

r, err := os.ReadFile(f.Name())
Expand Down
2 changes: 1 addition & 1 deletion core/web/bridge_types_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func TestBridgeTypesController_Update_Success(t *testing.T) {
require.NoError(t, app.BridgeORM().CreateBridgeType(ctx, bt))

body := fmt.Sprintf(`{"name": "%s","url":"http://yourbridge"}`, bridgeName)
ud := bytes.NewBuffer([]byte(body))
ud := bytes.NewBufferString(body)
resp, cleanup := client.Patch("/v2/bridge_types/"+bridgeName, ud)
t.Cleanup(cleanup)
cltest.AssertServerResponse(t, resp, http.StatusOK)
Expand Down
2 changes: 1 addition & 1 deletion core/web/evm_transfer_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func TestTransfersController_JSONBindingError(t *testing.T) {

client := app.NewHTTPClient(nil)

resp, cleanup := client.Post("/v2/transfers", bytes.NewBuffer([]byte(`{"address":""}`)))
resp, cleanup := client.Post("/v2/transfers", bytes.NewBufferString(`{"address":""}`))
t.Cleanup(cleanup)

cltest.AssertServerResponse(t, resp, http.StatusBadRequest)
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ linters-settings:
excludes:
- G101
govet:
# report about shadowed variables
check-shadowing: true
enable:
- shadow
revive:
confidence: 0.8
rules:
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/.tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ golang 1.21.7
k3d 5.4.6
kubectl 1.25.5
nodejs 20.13.1
golangci-lint 1.55.2
golangci-lint 1.59.1
2 changes: 1 addition & 1 deletion integration-tests/actions/seth/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ func SendLinkFundsToDeploymentAddresses(
return nil
}

var noOpSethConfigFn = func(cfg *seth.Config) error { return nil }
var noOpSethConfigFn = func(_ *seth.Config) error { return nil }

type SethConfigFunction = func(*seth.Config) error

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/actions/seth/keeper_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func DeployKeeperConsumers(t *testing.T, client *seth.Client, numberOfContracts

executor := ctf_concurrency.NewConcurrentExecutor[contracts.KeeperConsumer, keeperConsumerResult, ctf_concurrency.NoTaskType](l)

var deployContractFn = func(channel chan keeperConsumerResult, errorCh chan error, executorNum int) {
var deployContractFn = func(channel chan keeperConsumerResult, _ chan error, executorNum int) {
keyNum := executorNum + 1 // key 0 is the root key
var keeperConsumerInstance contracts.KeeperConsumer
var err error
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/contracts/contract_deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry(

registryLogicAAddr, _, _, err := e.client.DeployContract("AutomationRegistryLogicA2_2", func(
auth *bind.TransactOpts,
backend bind.ContractBackend,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {

return registrylogica22.DeployAutomationRegistryLogicA(
Expand All @@ -1275,7 +1275,7 @@ func (e *EthereumContractDeployer) DeployKeeperRegistry(

address, _, _, err := e.client.DeployContract("AutomationRegistry2_2", func(
auth *bind.TransactOpts,
backend bind.ContractBackend,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return registry22.DeployAutomationRegistry(
auth,
Expand Down Expand Up @@ -1460,7 +1460,7 @@ func (e *EthereumContractDeployer) DeployKeeperConsumer(updateInterval *big.Int)
func (e *EthereumContractDeployer) DeployAutomationLogTriggerConsumer(testInterval *big.Int) (KeeperConsumer, error) {
address, _, instance, err := e.client.DeployContract("LogUpkeepCounter", func(
auth *bind.TransactOpts,
backend bind.ContractBackend,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return log_upkeep_counter_wrapper.DeployLogUpkeepCounter(
auth, wrappers.MustNewWrappedContractBackend(e.client, nil), testInterval,
Expand Down Expand Up @@ -1498,7 +1498,7 @@ func (e *EthereumContractDeployer) DeployAutomationSimpleLogTriggerConsumer(isSt
func (e *EthereumContractDeployer) DeployAutomationStreamsLookupUpkeepConsumer(testRange *big.Int, interval *big.Int, useArbBlock bool, staging bool, verify bool) (KeeperConsumer, error) {
address, _, instance, err := e.client.DeployContract("StreamsLookupUpkeep", func(
auth *bind.TransactOpts,
backend bind.ContractBackend,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return streams_lookup_upkeep_wrapper.DeployStreamsLookupUpkeep(
auth, wrappers.MustNewWrappedContractBackend(e.client, nil), testRange, interval, useArbBlock, staging, verify,
Expand All @@ -1517,7 +1517,7 @@ func (e *EthereumContractDeployer) DeployAutomationStreamsLookupUpkeepConsumer(t
func (e *EthereumContractDeployer) DeployAutomationLogTriggeredStreamsLookupUpkeepConsumer() (KeeperConsumer, error) {
address, _, instance, err := e.client.DeployContract("LogTriggeredStreamsLookupUpkeep", func(
auth *bind.TransactOpts,
backend bind.ContractBackend,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return log_triggered_streams_lookup_wrapper.DeployLogTriggeredStreamsLookup(
auth, wrappers.MustNewWrappedContractBackend(e.client, nil), false, false, false,
Expand All @@ -1536,7 +1536,7 @@ func (e *EthereumContractDeployer) DeployAutomationLogTriggeredStreamsLookupUpke
func (e *EthereumContractDeployer) DeployUpkeepCounter(testRange *big.Int, interval *big.Int) (UpkeepCounter, error) {
address, _, instance, err := e.client.DeployContract("UpkeepCounter", func(
auth *bind.TransactOpts,
backend bind.ContractBackend,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return upkeep_counter_wrapper.DeployUpkeepCounter(auth, wrappers.MustNewWrappedContractBackend(e.client, nil), testRange, interval)
})
Expand Down

0 comments on commit 1d75e3e

Please sign in to comment.