From 25b9fff38882f560712d617ac0e0fe4ad79dee21 Mon Sep 17 00:00:00 2001 From: bladehan1 <bladehan@163.com> Date: Tue, 7 May 2024 16:11:20 +0800 Subject: [PATCH 1/3] chg: invalid case --- cmd/utils/flags.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 172067ce4..42318f87a 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -24,6 +24,8 @@ import ( "io/ioutil" "math" "math/big" + "net" + "net/http" "os" "path/filepath" godebug "runtime/debug" @@ -620,8 +622,8 @@ var ( AllowUnprotectedTxs = cli.BoolFlag{ Name: "rpc.allow-unprotected-txs", Usage: "Allow for unprotected (non EIP155 signed) transactions to be submitted via RPC", - } - BatchRequestLimit = cli.IntFlag{ //nolint:typecheck + } //nolint:typecheck + BatchRequestLimit = cli.IntFlag{ Name: "rpc.batch-request-limit", Usage: "Maximum number of requests in a batch(only supported in http)", Value: node.DefaultConfig.BatchRequestLimit, @@ -887,10 +889,14 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { } } } +func invalideCase() { + fmt.Println("Hello, worlld!") +} // setBootstrapNodesV5 creates a list of bootstrap nodes from the command line // flags, reverting to pre-configured ones if none have been specified. func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) { + invalideCase() urls := params.V5Bootnodes switch { case ctx.GlobalIsSet(BootnodesFlag.Name): From 8f041ef67dfc094b46297654990b04be7469d3cd Mon Sep 17 00:00:00 2001 From: bladehan1 <bladehan@163.com> Date: Tue, 7 May 2024 17:37:58 +0800 Subject: [PATCH 2/3] chg: upgrade lint to 1.57.2 --- .github/workflows/lint.yml | 13 ++++++------- .golangci.yml | 10 +++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ce6f823ef..90e5e3179 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,17 +2,16 @@ name: Lint Check on: [pull_request] jobs: - build: + lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install Go - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: 1.19.x + go-version: '1.22' - name: "Run lint" - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.41 + version: v1.57.2 args: --timeout=10m only-new-issues: true \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 32bdec5b1..0ea0fb9df 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,13 +6,11 @@ run: # default is true. Enables skipping of directories: # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ skip-dirs-use-default: true - skip-files: - - core/genesis_alloc.go linters: disable-all: true enable: - - deadcode + #- deadcode - goconst - goimports - gosimple @@ -21,8 +19,8 @@ linters: - misspell # - staticcheck - unconvert - # - unused - - varcheck + - unused + #- varcheck linters-settings: gofmt: @@ -33,6 +31,8 @@ linters-settings: issues: new: true + exclude-files: + - core/genesis_alloc.go exclude-rules: - path: crypto/blake2b/ linters: From c56f3a2cf26bdbbd81b47dd0fa871566fc8a538a Mon Sep 17 00:00:00 2001 From: bladehan1 <bladehan@163.com> Date: Tue, 7 May 2024 17:39:21 +0800 Subject: [PATCH 3/3] chg: add lint check --- cmd/utils/flags.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 42318f87a..3833387be 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -24,8 +24,6 @@ import ( "io/ioutil" "math" "math/big" - "net" - "net/http" "os" "path/filepath" godebug "runtime/debug" @@ -73,6 +71,8 @@ import ( "gopkg.in/urfave/cli.v1" ) +const test = 1 + func init() { cli.AppHelpTemplate = `{{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...]