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

Integration with golangci-lint #184

Closed
SVilgelm opened this issue Aug 2, 2020 · 9 comments
Closed

Integration with golangci-lint #184

SVilgelm opened this issue Aug 2, 2020 · 9 comments

Comments

@SVilgelm
Copy link
Contributor

SVilgelm commented Aug 2, 2020

Hi,
The golangci-lint has an integration with errcheck, but is very outdated. it uses a fork of errcheck to export some functions. So would it be possible to include code such this: https://github.com/golangci/errcheck/blob/master/golangci/golangci.go to errcheck repo?
I'm ready to raise a PR
I want to get rid of fork and use the main repo instead.

Thank you!

@SVilgelm
Copy link
Contributor Author

SVilgelm commented Aug 2, 2020

@kisielk Hi, could you please take a look at this?

@kisielk
Copy link
Owner

kisielk commented Aug 2, 2020

So just to be clear about your request, you're basically asking to make the internal/errcheck package available as a regular importable package?

@echlebek
Copy link
Collaborator

echlebek commented Aug 2, 2020

#185 makes the errcheck package available.

@SVilgelm
Copy link
Contributor Author

SVilgelm commented Aug 2, 2020

@kisielk almost yes, if you can also change the Checker.exclude to be exported (Checker.Exclude), then golangci can use the Checker as a config

@echlebek Thank you so much for the PR, could you also change Checker.exclude to Checker.Exclude?

@echlebek
Copy link
Collaborator

echlebek commented Aug 3, 2020

@SVilgelm just curious why you need this. Is there something you need to do that isn't covered by AddExcludes()?

@SVilgelm
Copy link
Contributor Author

SVilgelm commented Aug 3, 2020

in golangci-lint we have a special structure: https://github.com/golangci/errcheck/blob/master/golangci/golangci.go#L22
so the users can configure errcheck in the global config file, the structure is totally same as the Checker, except Exclude field, so I think it would be easier to use the Checker instead of implementing own Config

@SVilgelm
Copy link
Contributor Author

SVilgelm commented Aug 4, 2020

sorry, I was wrong, we actually don't need the Excludes to be exported, I can use AddExcludes function and will use the Checker directly here: https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/errcheck.go#L107

@SVilgelm
Copy link
Contributor Author

SVilgelm commented Aug 4, 2020

so, give me a couple of days, I will test the golangci-lint with the #185 PR

@echlebek
Copy link
Collaborator

@SVilgelm we've now published errcheck as a library. It does differ from what you were working with, but should meet your use case. If not, we'll do some follow-up work! Closing this now.

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

No branches or pull requests

3 participants