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

wwhrd does not check license of dependencies only used in tests ( *_test.go) #49

Closed
breml opened this issue Dec 9, 2020 · 3 comments · Fixed by #50
Closed

wwhrd does not check license of dependencies only used in tests ( *_test.go) #49

breml opened this issue Dec 9, 2020 · 3 comments · Fixed by #50
Assignees

Comments

@breml
Copy link
Contributor

breml commented Dec 9, 2020

While checking the results of the update in #46, I found out, that _test.go files are skipped. I was not aware of this and I think it is nowhere documented. Anyway, I would like to have an option/flag to enable the inclusion of the _test.go files in order to check all licenses, that are touched by a Go repository.

The respective check is here:

wwhrd/walker.go

Line 380 in dc59aff

if strings.HasSuffix(path, "_test.go") {

@frapposelli
Copy link
Owner

@breml yes, this was a deliberate design choice as testing dependencies are not compiled into the shipping binaries thus normally not subjected to license checks (e.g., I could test my software with a GPL-2 library and distribute it with an incompatible license).

That said, having an optional toggle for that is a good idea. I'll add it to the backlog.

@frapposelli frapposelli self-assigned this Dec 9, 2020
@breml
Copy link
Contributor Author

breml commented Dec 14, 2020

@frapposelli Thanks for your reply and for adding this issue to the backlog. I guess the main problem for me has been, that this behavior is not documented. So as a quick fix, maybe we can just improve the documentation and make it explicit, that dependencies in _test.go are ignored.

I still think, it would be good to have an additional option to control, how dependencies used only in tests are handled. I agree with you, that e.g. GPL-2 is not a problem, when used in test. The other day I realized though, that we have used https://github.com/bouk/monkey in one of our tests and the license is pretty adventurous from a business point of view, even if used in tests.

With all of this said, I think it would be good to have the flag to check the licenses used in tests as well. Additionally I assume, that this change would make it necessary to have the respective sections in the config file as well to config a blacklist, whitelist and exceptions for licenses used only in tests.

@frapposelli
Copy link
Owner

Cutting v0.4.0-rc.1 with this enhancement right now.

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

Successfully merging a pull request may close this issue.

2 participants