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 support to exclude by file regexp #253

Open
tzvatot opened this issue Aug 27, 2024 · 2 comments
Open

Add support to exclude by file regexp #253

tzvatot opened this issue Aug 27, 2024 · 2 comments

Comments

@tzvatot
Copy link

tzvatot commented Aug 27, 2024

I want to be able to exclude the linter for files ending with "_test.go" suffix. Is there a way to do it? is there a regexp exclusion support/

@dtcaciuc
Copy link
Collaborator

There's no existing feature and nothing like that is planned at the moment. Use of a regex or glob for this purpose can easily misfire and unintentionally mute errors in new files that are added after the exclusion is introduced. See similar issue here #250

I'm surprised you're trying to exclude test files where I would expect you want to check any and all errors? 🤔

@dtcaciuc
Copy link
Collaborator

dtcaciuc commented Oct 17, 2024

Actually, I didn't realize we do have a feature which should let you accomplish what you want. From the README:

The -ignoretests flag disables checking of _test.go files. It takes no arguments

Does that work for you?

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

2 participants