Skip to content

Commit

Permalink
Added lint configuration and fixed error (#28)
Browse files Browse the repository at this point in the history
Will try to set up presubmit integration in subsequent PR.
For now, `golangci-lint run` at least passes locally, which is
still an improvement from before this PR.
  • Loading branch information
mhutchinson authored May 27, 2022
1 parent 9998f54 commit ff6e921
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 90s

linters-settings:
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 25
depguard:
list-type: blacklist
packages:
- golang.org/x/net/context
- github.com/gogo/protobuf/proto

linters:
disable-all: true
enable:
- deadcode
- depguard
- gocyclo
- gofmt
- goimports
- govet
- ineffassign
- megacheck
- misspell
- revive
- varcheck

issues:
# Don't turn off any checks by default. We can do this explicitly if needed.
exclude-use-default: false
7 changes: 0 additions & 7 deletions proof/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,3 @@ func dh(h string, expLen int) []byte {
}
return r
}

func shortHash(hash []byte) string {
if len(hash) == 0 {
return "<empty>"
}
return fmt.Sprintf("%x...", hash[:4])
}

0 comments on commit ff6e921

Please sign in to comment.