Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add go linting to CI config #2018

Merged
merged 3 commits into from
Dec 20, 2018
Merged

Add go linting to CI config #2018

merged 3 commits into from
Dec 20, 2018

Conversation

klingerf
Copy link
Contributor

This branch starts running golint on every CI build. I'm expecting this PR to fail CI with 8 lint warning, which I'll clean up in a subsequent commit. This is a follow-up to #1982.

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
@klingerf klingerf self-assigned this Dec 20, 2018
@klingerf klingerf requested a review from siggy December 20, 2018 22:18
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
@klingerf
Copy link
Contributor Author

CI passed 🎉 -- this is now ready for review.

Copy link
Member

@siggy siggy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Sweet how you used this PR to fix linting in the 2nd commit. 👍 🚢

Consider adding a note on running this in TEST.md, somewhere around mention of go vet ./....

go install ./vendor/golang.org/x/lint/golint

# use `go list` to exclude packages in vendor, ignore uncommented warnings
out=$(go list ./... | xargs golint | grep -v 'should have comment') || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative to this would be to use golangci-lint run --disable-all -E golint - this ignores all comment related linter errors, and in the future we could enable even more linters by adding a linter config file. If golint is the only one needed, then this is perfect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! I had no idea that the go linting rabbit hole goes so deep :)

I wouldn't be opposed to adding additional linting configurations going forward, but I think golint minus comments suffices for our use case right now. That said, I'd happily review a PR that improved upon it. Thanks for the suggestion!

Copy link

@rmars rmars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎾 🥇

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
@klingerf klingerf merged commit f1b0983 into master Dec 20, 2018
@klingerf klingerf deleted the kl/golint branch December 20, 2018 23:33
siggy added a commit that referenced this pull request Dec 22, 2018
Part of #217. Follow up from #1982 and #2018.

A subsequent commit will fix the ci failure.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
siggy added a commit that referenced this pull request Jan 2, 2019
Commit 1: Enable lint check for comments

Part of #217. Follow up from #1982 and #2018.

A subsequent commit will fix the ci failure.

Commit 2: Address all comment-related linter errors.

This change addresses all comment-related linter errors by doing the
following:
- Add comments to exported symbols
- Make some exported symbols private
- Recommend via TODOs that some exported symbols should should move or
  be removed

This PR does not:
- Modify, move, or remove any code
- Modify existing comments

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
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.

4 participants