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

Ignore vendored dependencies, or those ending with certain filenames #57

Closed
fortytw2 opened this issue Jan 30, 2017 · 4 comments
Closed
Labels

Comments

@fortytw2
Copy link

Would be lovely to have the option to ignore folders or file prefixes (i.e. _generated.go), so this fortytw2/hydrocarbon#30 can be avoided in the future 😄

@bradleyfalzon
Copy link
Owner

bradleyfalzon commented Jan 30, 2017

Yes agreed, there was a discussion on golang/go#13560 about this to detected generated code. What are the conventions at the moment, or just make it configurable (always ignore files matching X regexp)?

Edit, go-tools uses https://sourcegraph.com/github.com/dominikh/go-tools@949608b91d181682001f931700497fb4a6a9e793/-/blob/lint/lint.go#L436:16-436:27

@fortytw2
Copy link
Author

I don't know if there are any great conventions right now - perhaps a combination of what go-tools does, with an optional "additional regexp filenames" would be sufficient?

@bradleyfalzon
Copy link
Owner

Yeah sgtm.

Relates #8

@dmitshur
Copy link

Until golang/go#13560 is resolved, there is no official standard. I created https://github.com/shurcooL/go/blob/978ecf0df5227d84eec040632ee76669b5a93619/analysis/generated_detection.go#L17 as a best effort solution until then.

bradleyfalzon added a commit that referenced this issue Feb 25, 2017
We consider generated code, anything that appears to be generated
or is in a vendor/testdata directory. GopherCI uses
github.com/gopherci/isFileGenerated which mostly uses a function
provided by github.com/shurcooL/go.

In using isFileGenerated, it makes it difficult for a user to provide
additional files to be ignored, this would need to be implemented in
similar areas by other method if we decide to support that option.

This causes all issues from generated code to be ignored, there
will be no option to only comment, or only set the build to failed
as the issue will be ignored as soon as it's detected.

An additional integration test has been provided, because although
there are unit tests, it's possible the underlying tools misbehave
or change their implementation details.

Resolves #57.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants