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

errcheck: allow exclude config without extra file #2110

Merged
merged 3 commits into from
Jul 13, 2021

Conversation

rliebz
Copy link
Contributor

@rliebz rliebz commented Jul 10, 2021

One of the challenges in standardizing on a golangci-lint configuration is that if we want to configure errcheck, it requires two separate files to configure: the golangci config file, plus a separate errcheck excludes file.
In particular, copying golangci-lint configs across projects often fails, as a reference to an exclude file at a particular file will not resolve.

While this config does not add any new functionality, it allows the entirety of the errcheck configuration to be done inside the
golangci-lint config file itself.

https://github.com/kisielk/errcheck#excluding-functions

One of the challenges in standardizing on a golangci-lint configuration
is that if we want to configure `errcheck`, it requires two separate
files to configure: the golangci config file, plus a separate errcheck
excludes file. In particular, copying golangci-lint configs across
projects often fails, as a reference to an exclude file at a particular
file will not resolve.

While this config does not add any new functionality, it allows the
entirety of the errcheck configuration to be done inside the
golangci-lint config file itself.
@ldez ldez self-requested a review July 10, 2021 01:38
@ldez ldez added the enhancement New feature or improvement label Jul 10, 2021
pkg/commands/run.go Outdated Show resolved Hide resolved
test/testdata/errcheck_exclude_functions.go Outdated Show resolved Hide resolved
@rliebz
Copy link
Contributor Author

rliebz commented Jul 10, 2021

Thanks for the quick feedback, all comments addressed!

Not sure if there's anything I need to do to get the pipeline to pass. It's failing on a make build test, which is passing for me locally

@ldez ldez changed the title Allow errcheck exclude config without extra file errcheck: allow exclude config without extra file Jul 10, 2021
@ldez ldez merged commit b3f9763 into golangci:master Jul 13, 2021
@golangci-automator
Copy link

Hey, @rliebz — we just merged your PR to golangci-lint! 🔥🚀

golangci-lint is built by awesome people like you. Let us say “thanks”: we just invited you to join the GolangCI organization on GitHub.
This will add you to our team of maintainers. Accept the invite by visiting this link.

By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.
More information about contributing is here.

Thanks again!

@rliebz rliebz deleted the errcheck-exclude-functions branch July 14, 2021 00:08
@magnetikonline
Copy link
Contributor

@rliebz great to see this just land in 1.42.0 - was hoping this issue would be addressed one day! 👍

SeigeC pushed a commit to SeigeC/golangci-lint that referenced this pull request Apr 4, 2023
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
@ldez ldez added this to the v1.42 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants