ci: fix goimports lint in CI (#628)

* ci: fix goimports lint in CI

* use different go versions for goimports and go mod tidy

* goimports
This commit is contained in:
Péter Garamvölgyi 2024-02-09 13:25:59 +01:00 committed by GitHub
parent ae7cbae19c
commit 7e3a7ae744
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 3 deletions

View file

@ -69,15 +69,31 @@ jobs:
- name: Install Go - name: Install Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.20.x go-version: 1.18.x
- name: Install goimports - name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest run: go install golang.org/x/tools/cmd/goimports@latest
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- run: goimports -local github.com/scroll-tech/go-ethereum/ -w . - run: goimports -local github.com/scroll-tech/go-ethereum/ -w .
# If there are any diffs from goimports, fail.
- name: Verify no changes from goimports
run: |
if [ -n "$(git status --porcelain)" ]; then
exit 1
fi
go-mod-tidy-lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v2
- run: go mod tidy - run: go mod tidy
# If there are any diffs from goimports or go mod tidy, fail. # If there are any diffs from go mod tidy, fail.
- name: Verify no changes from goimports and go mod tidy - name: Verify no changes from go mod tidy
run: | run: |
if [ -n "$(git status --porcelain)" ]; then if [ -n "$(git status --porcelain)" ]; then
exit 1 exit 1

View file

@ -22,6 +22,7 @@ import (
"math/big" "math/big"
"github.com/holiman/uint256" "github.com/holiman/uint256"
"github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/crypto/kzg4844" "github.com/scroll-tech/go-ethereum/crypto/kzg4844"
"github.com/scroll-tech/go-ethereum/params" "github.com/scroll-tech/go-ethereum/params"

View file

@ -22,6 +22,7 @@ import (
"math/big" "math/big"
"github.com/holiman/uint256" "github.com/holiman/uint256"
"github.com/scroll-tech/go-ethereum/common" "github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/hexutil"
) )

View file

@ -25,6 +25,7 @@ import (
gokzg4844 "github.com/crate-crypto/go-kzg-4844" gokzg4844 "github.com/crate-crypto/go-kzg-4844"
ckzg4844 "github.com/ethereum/c-kzg-4844/bindings/go" ckzg4844 "github.com/ethereum/c-kzg-4844/bindings/go"
"github.com/scroll-tech/go-ethereum/common/hexutil" "github.com/scroll-tech/go-ethereum/common/hexutil"
) )