We are getting an A+ on Go Report Card, but there is still a lot to improve:
~https://goreportcard.com/report/github.com/runconduit/conduit~
https://goreportcard.com/report/github.com/linkerd/linkerd2
We should consider these changes, and also add a badge to README.md.
Hmm, looks like almost all of the issues in the repo could be found with the golint tool. We should get in the habit of running that.
Should we create a precommit.sh file or something that does a standardized go test ./... && go vet ./... && golint? Also could be the script travis runs
Yeah, I'd be in favor of auto-running some form of linting, but I'd like to investigate if the linting rules are configurable before we start failing builds. There are a few things turned up by the linter that don't seem important to me, such as:
var mockApiClient should be mockAPIClient
Heh, and this one:
func name will be used as version.VersionFlag by other packages, and that stutters; consider calling this Flag
I am very easygoing with these things, I can definitely live with the silly ones if it gives us a standardised and well-supported way to check for more interesting things.
IMHO I am not really about skipping these lint errors, it's pretty handy for writing idiomatic golang code ^.^
Also it might be required if you decide to add it at awesome-go list
Taking this a bit further, #2284 introduced a .golangci.yml file, which specifies which golangci-lint checkers to run.
To help improve the codebase further, we should work towards reducing the number of checkers in the disable list. Essentially repeat this pattern:
disable listbin/lint, observe errorsbin/lint succeeds@siggy this issue doesn't feel particularly actionable at this point (and there's a ton of awesome work that's already been done). WDYT about closing this out and opening up directed issues for what's remaining?
@grampelberg I'm fine with closing this one.
Note that we lost our perfect gofmt score recently:
https://goreportcard.com/report/github.com/linkerd/linkerd2#gofmt
This may have happened when we changed our lint config, probably worth a new issue to track this.
I was wondering about that. Thanks!