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: diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 172067ce4..3833387be 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -71,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...] @@ -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):