Skip to content

build: update metalinter to v2#15638

Closed
zramsay wants to merge 2 commits into
ethereum:masterfrom
bluecollarcoding:linter-update-to-v2
Closed

build: update metalinter to v2#15638
zramsay wants to merge 2 commits into
ethereum:masterfrom
bluecollarcoding:linter-update-to-v2

Conversation

@zramsay
Copy link
Copy Markdown
Contributor

@zramsay zramsay commented Dec 9, 2017

@fjl fjl changed the title update metalinter to v2 build: update metalinter to v2 Dec 9, 2017
@fjl
Copy link
Copy Markdown
Contributor

fjl commented Dec 10, 2017

I've tried this and it's much faster. But it also detects new gosimple warnings:

>>> /tmp/go-ethereum.WcQZKW/go-ethereum/build/_workspace/src/github.com/ethereum/go-ethereum/build/bin/gometalinter.v2 --vendor --deadline=10m --disable-all --enable=gosimple ./...
accounts/abi/bind/bind.go:132:9:warning: should use buffer.String() instead of string(buffer.Bytes()) (S1030) (gosimple)
accounts/abi/unpack_test.go:371:6:warning: should use !bytes.Equal(p0, p0Exp) instead (S1004) (gosimple)
accounts/abi/unpack_test.go:375:6:warning: should use !bytes.Equal(p1[:], p1Exp) instead (S1004) (gosimple)
bmt/bmt.go:263:4:warning: should merge variable declaration with assignment on next line (S1021) (gosimple)
cmd/faucet/faucet.go:509:94:warning: should use time.Until instead of t.Sub(time.Now()) (S1024) (gosimple)
consensus/clique/clique.go:633:11:warning: should use time.Until instead of t.Sub(time.Now()) (S1024) (gosimple)
console/console_test.go:167:12:warning: should use tester.output.String() instead of string(tester.output.Bytes()) (S1030) (gosimple)
console/console_test.go:191:15:warning: should use tester.output.String() instead of string(tester.output.Bytes()) (S1030) (gosimple)
console/console_test.go:221:15:warning: should use tester.output.String() instead of string(tester.output.Bytes()) (S1030) (gosimple)
console/console_test.go:233:15:warning: should use tester.output.String() instead of string(tester.output.Bytes()) (S1030) (gosimple)
console/console_test.go:246:15:warning: should use tester.output.String() instead of string(tester.output.Bytes()) (S1030) (gosimple)
console/console_test.go:278:15:warning: should use tester.output.String() instead of string(tester.output.Bytes()) (S1030) (gosimple)
console/console_test.go:290:15:warning: should use tester.output.String() instead of string(tester.output.Bytes()) (S1030) (gosimple)
core/asm/asm.go:117:2:warning: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013) (gosimple)
core/asm/compiler.go:240:2:warning: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008) (gosimple)
ethstats/ethstats.go:196:3:warning: redundant return statement (S1023) (gosimple)
p2p/discv5/ticket.go:401:5:warning: unnecessary nil check around range (S1031) (gosimple)
p2p/simulations/network.go:406:2:warning: should replace loop with nodes = append(nodes, self.Nodes...) (S1011) (gosimple)
p2p/simulations/network.go:480:5:warning: should use time.Since instead of time.Now().Sub (S1012) (gosimple)
rpc/http_test.go:35:23:warning: should use make([]rune, maxHTTPRequestContentLength + 1) instead (S1019) (gosimple)
swarm/fuse/swarmfs_test.go:98:5:warning: should omit comparison to bool constant, can be simplified to !found (S1002) (gosimple)
swarm/fuse/swarmfs_test.go:188:2:warning: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008) (gosimple)
swarm/fuse/swarmfs_test.go:391:5:warning: should use !bytes.Equal(finfo.contents[:6024][5000:], contents) instead (S1004) (gosimple)
swarm/storage/chunker_test.go:80:9:warning: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028) (gosimple)
swarm/storage/chunker_test.go:126:9:warning: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028) (gosimple)
swarm/storage/pyramid.go:394:5:warning: should omit comparison to bool constant, can be simplified to isAppend (S1002) (gosimple)
swarm/storage/pyramid.go:515:5:warning: should omit comparison to bool constant, can be simplified to !compress (S1002) (gosimple)
swarm/storage/pyramid.go:515:26:warning: should omit comparison to bool constant, can be simplified to !last (S1002) (gosimple)
swarm/storage/pyramid.go:525:23:warning: should omit comparison to bool constant, can be simplified to last (S1002) (gosimple)
swarm/storage/pyramid.go:543:7:warning: should omit comparison to bool constant, can be simplified to isAppend (S1002) (gosimple)
swarm/storage/pyramid.go:543:47:warning: should omit comparison to bool constant, can be simplified to tempEntry.updatePending (S1002) (gosimple)
swarm/storage/pyramid.go:588:6:warning: should omit comparison to bool constant, can be simplified to !isAppend (S1002) (gosimple)
swarm/storage/pyramid.go:590:7:warning: should omit comparison to bool constant, can be simplified to compress (S1002) (gosimple)
swarm/storage/pyramid.go:602:6:warning: should omit comparison to bool constant, can be simplified to last (S1002) (gosimple)
swarm/storage/pyramid.go:615:6:warning: should omit comparison to bool constant, can be simplified to ent.updatePending (S1002) (gosimple)
whisper/whisperv6/whisper_test.go:83:2:warning: should merge variable declaration with assignment on next line (S1021) (gosimple)

@zramsay
Copy link
Copy Markdown
Contributor Author

zramsay commented Dec 10, 2017

weird, I don't get the lint warnings when running locally (or see it on the CI). Maybe it's go version thing? Anyways, I've address all but a couple lints

missing:

cmd/faucet/faucet.go:509:94:warning: should use time.Until instead of t.Sub(time.Now()) (S1024) (gosimple)
p2p/discv5/ticket.go:401:5:warning: unnecessary nil check around range (S1031) (gosimple)

Also, I can't find this PR on https://travis-ci.org/ethereum/go-ethereum/pull_requests ?

@zramsay zramsay force-pushed the linter-update-to-v2 branch from 5b421dc to 06a6842 Compare December 10, 2017 16:09
@fjl
Copy link
Copy Markdown
Contributor

fjl commented Dec 10, 2017

Yeah, not sure what's up with Travis

@fjl
Copy link
Copy Markdown
Contributor

fjl commented Dec 10, 2017

Maybe push again to trigger it

@zramsay zramsay force-pushed the linter-update-to-v2 branch from 06a6842 to 67a6713 Compare December 10, 2017 22:32
@fjl fjl closed this Dec 11, 2017
@fjl
Copy link
Copy Markdown
Contributor

fjl commented Dec 11, 2017

Travis is still refusing to look at this PR. Please resubmit.

@ferhatelmas
Copy link
Copy Markdown
Contributor

@fjl @zramsay I would send this update but misspell was broken and I was waiting on misspell#127.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants