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 comments, remove underscores to be "more go-like" #73

Closed
parkr opened this issue Sep 8, 2015 · 5 comments
Closed

add comments, remove underscores to be "more go-like" #73

parkr opened this issue Sep 8, 2015 · 5 comments

Comments

@parkr
Copy link

parkr commented Sep 8, 2015

Running golint across our .pb.go files yields quite a number of issues. It would be great to either have golint ignore .pb.go files by default, or to have this library generate code golint will happily find acceptable. Key issues:

  • Id -> ID
  • "exported thing X should have comment or be unexported"
  • "don't use underscores in Go names; struct field XXX_unrecognized should be XXXUnrecognized"

Thank you!

Prior art: #53

@dsymonds
Copy link
Contributor

dsymonds commented Sep 8, 2015

Don't run golint on generated .pb.go files. There will be endless things flagged, and in general we only care about golint on human-written code. The protocol compiler can't be smart in the way that a human can.

@dsymonds dsymonds closed this as completed Sep 8, 2015
@parkr
Copy link
Author

parkr commented Sep 8, 2015

@dsymonds Would you consider a PR that ignores .pb.go files in golint? At the moment, I'm running golint ./folder instead of on each file individually.

@dsymonds
Copy link
Contributor

dsymonds commented Sep 8, 2015

Nope. Just grep them out of the output or do something like find ./folder | grep -v '\.pb\.go$' | xargs golint.

@parkr
Copy link
Author

parkr commented Sep 8, 2015

Seems like that oughtn't be necessary for known exceptions, but you got it, boss.

@solher
Copy link

solher commented Jul 10, 2016

The problem is not really about the .pb.go files. It is that you end up using the generated service interfaces in your app code and then your actual app code doesn't pass the linter anymore because of it.

I think it should be considered a real issue to have the official protobuf package triggering warnings from the official linter package.

@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants