build: move golangci flags to its own config file.
This commit is contained in:
parent
59e1d24513
commit
4c70396e67
4
.github/workflows/go.yml
vendored
4
.github/workflows/go.yml
vendored
@ -16,9 +16,9 @@ jobs:
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- name: Check out source
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
|
||||
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 #v3.5.0
|
||||
- name: Install Linters
|
||||
run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.1"
|
||||
run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2"
|
||||
- name: Build
|
||||
run: go build ./...
|
||||
- name: Test
|
||||
|
||||
30
.golangci.yml
Normal file
30
.golangci.yml
Normal file
@ -0,0 +1,30 @@
|
||||
run:
|
||||
deadline: 10m
|
||||
|
||||
linters:
|
||||
build-tags:
|
||||
- rpctest
|
||||
|
||||
disable-all: true
|
||||
enable:
|
||||
- asciicheck
|
||||
- bidichk
|
||||
- bodyclose
|
||||
- durationcheck
|
||||
- errchkjson
|
||||
- exportloopref
|
||||
- gofmt
|
||||
- goimports
|
||||
- gosimple
|
||||
- govet
|
||||
- grouper
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nosprintfhostport
|
||||
- reassign
|
||||
- rowserrcheck
|
||||
- tparallel
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- vetshadow
|
||||
@ -319,7 +319,7 @@ func newBlockImporter(ctx context.Context, db database.DB, utxoDb *leveldb.DB, r
|
||||
MaxSize: 100 * 1024 * 1024, // 100 MiB
|
||||
})
|
||||
|
||||
chain, err := blockchain.New(context.Background(),
|
||||
chain, err := blockchain.New(ctx,
|
||||
&blockchain.Config{
|
||||
DB: db,
|
||||
ChainParams: activeNetParams,
|
||||
|
||||
@ -39,14 +39,7 @@ for module in $MODPATHS; do
|
||||
cd $MODNAME
|
||||
|
||||
# run linters
|
||||
golangci-lint run --build-tags=rpctest --disable-all --deadline=10m \
|
||||
--enable=gofmt \
|
||||
--enable=gosimple \
|
||||
--enable=unconvert \
|
||||
--enable=ineffassign \
|
||||
--enable=govet \
|
||||
--enable=misspell \
|
||||
--enable=unused \
|
||||
golangci-lint run
|
||||
)
|
||||
done
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user