Skip to content

Add support to ignore test files when using errcheck #496

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

Closed
wants to merge 2 commits into from
Closed

Add support to ignore test files when using errcheck #496

wants to merge 2 commits into from

Conversation

alaypatel07
Copy link

This PR solves #493 by adding without-tests field to errcheck.

Depends on golangci/errcheck#2

@CLAassistant
Copy link

CLAassistant commented Apr 12, 2019

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jirfag
Copy link
Contributor

jirfag commented Apr 20, 2019

hi, thank you for the pull request!
we already have settings for ignoring test files for a specific linter:

  exclude-rules:
    # Exclude some linters from running on tests files.
    - path: _test\.go
      linters:
        - errcheck

can you use this solution?

@alaypatel07
Copy link
Author

@jirfag Thanks for the alternative path, it worked for me.

I guess that makes this PR redundant, closing it and the issue. Thanks

@alaypatel07 alaypatel07 deleted the issue/ignore-tests branch April 20, 2019 19:44
@mattbirman
Copy link

mattbirman commented Jul 18, 2019

Hey @jirfag, I am running into the same issue and this solution is not working for me.

In my .golangci.yml file I have the following:

exclude-rules:
    - path: _test\.go
      linters:
        - gosec

but golangci-lint still fails on gosec lint errors in *.test.go files. Do you have any idea why this may not be working?

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