Skip to content

Commit 7e3a7ae

Browse files
authored
ci: fix goimports lint in CI (#628)
* ci: fix goimports lint in CI * use different go versions for goimports and go mod tidy * goimports
1 parent ae7cbae commit 7e3a7ae

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

.github/workflows/l2geth_ci.yml

+19-3
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,31 @@ jobs:
6969
- name: Install Go
7070
uses: actions/setup-go@v2
7171
with:
72-
go-version: 1.20.x
72+
go-version: 1.18.x
7373
- name: Install goimports
7474
run: go install golang.org/x/tools/cmd/goimports@latest
7575
- name: Checkout code
7676
uses: actions/checkout@v2
7777
- run: goimports -local github.com/scroll-tech/go-ethereum/ -w .
78+
# If there are any diffs from goimports, fail.
79+
- name: Verify no changes from goimports
80+
run: |
81+
if [ -n "$(git status --porcelain)" ]; then
82+
exit 1
83+
fi
84+
go-mod-tidy-lint:
85+
if: github.event.pull_request.draft == false
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Install Go
89+
uses: actions/setup-go@v2
90+
with:
91+
go-version: 1.20.x
92+
- name: Checkout code
93+
uses: actions/checkout@v2
7894
- run: go mod tidy
79-
# If there are any diffs from goimports or go mod tidy, fail.
80-
- name: Verify no changes from goimports and go mod tidy
95+
# If there are any diffs from go mod tidy, fail.
96+
- name: Verify no changes from go mod tidy
8197
run: |
8298
if [ -n "$(git status --porcelain)" ]; then
8399
exit 1

core/types/blob_tx.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"math/big"
2323

2424
"github.com/holiman/uint256"
25+
2526
"github.com/scroll-tech/go-ethereum/common"
2627
"github.com/scroll-tech/go-ethereum/crypto/kzg4844"
2728
"github.com/scroll-tech/go-ethereum/params"

core/types/transaction_marshalling.go

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"math/big"
2323

2424
"github.com/holiman/uint256"
25+
2526
"github.com/scroll-tech/go-ethereum/common"
2627
"github.com/scroll-tech/go-ethereum/common/hexutil"
2728
)

crypto/kzg4844/kzg4844_ckzg_cgo.go

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
gokzg4844 "github.com/crate-crypto/go-kzg-4844"
2727
ckzg4844 "github.com/ethereum/c-kzg-4844/bindings/go"
28+
2829
"github.com/scroll-tech/go-ethereum/common/hexutil"
2930
)
3031

0 commit comments

Comments
 (0)