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

suppress golint messages #1054

Merged
merged 1 commit into from
Feb 24, 2020
Merged

suppress golint messages #1054

merged 1 commit into from
Feb 24, 2020

Conversation

vvakame
Copy link
Collaborator

@vvakame vvakame commented Feb 20, 2020

I tried new resolver layout. It's pretty nice!
In my app, golint emit messages to resolver files.

package comment should be of the form "Package graphqlapi ..."
exported method Resolver.CircleExhibitInfo should have comment or be unexported

I wanna suppress it.
gqlgen maintenance files are manually edited & generated file both.
I can't ignore these messages...

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

func (r *Resolver) Subscription() SubscriptionResolver { return &subscriptionResolver{r} }
func (r *Resolver) User() UserResolver { return &userResolver{r} }

// Panics returns PanicsResolver implementation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤢

If you can build them out of a template then its not giving any context or new information to the reader. This is just pure noise.

can we tell golint to ignore these semi-generated files instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, We can't... 😿 I agreed about its noisy comment. but I need suppress golint error messages...
golint can't configure that same as gofmt.
golint only have -min_confidence options.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I highly recommend https://github.com/golangci/golangci-lint.

It will speed up your builds, provide consistent formatting and give you the ability to skip linters consistently on a line/function/file basis based on consistent comments - https://github.com/golangci/golangci-lint#false-positives

Copy link
Collaborator Author

@vvakame vvakame Feb 23, 2020

Choose a reason for hiding this comment

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

yes, I know... but Our project can't it immediately.
and, I don't think gqlgen should not limit what tools users should use.
this change is little bit noisy, but useful for golint user I think.

@vvakame vvakame requested a review from vektah February 21, 2020 12:34
Copy link
Collaborator

@vektah vektah left a comment

Choose a reason for hiding this comment

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

:( Okay

@vvakame vvakame merged commit b788cce into master Feb 24, 2020
@vvakame vvakame deleted the golint-free-resolvers branch February 24, 2020 06:11
@vvakame
Copy link
Collaborator Author

vvakame commented Feb 24, 2020

thanks! 👍 🙇

cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
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.

2 participants