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

Can not detect license of packages imported only in tests #62

Closed
blanet opened this issue Apr 19, 2021 · 6 comments · Fixed by #160
Closed

Can not detect license of packages imported only in tests #62

blanet opened this issue Apr 19, 2021 · 6 comments · Fixed by #160
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@blanet
Copy link

blanet commented Apr 19, 2021

go-licenses can not detect packages that only imported in tests. Do we have any plan to support it?

@lwaddicor
Copy link

This functionality would be very useful

@Bobgy
Copy link
Collaborator

Bobgy commented Apr 11, 2022

cfg := &packages.Config{
Context: ctx,
Mode: packages.NeedImports | packages.NeedDeps | packages.NeedFiles | packages.NeedName | packages.NeedModule,
}

If the config here gets a Tests: true argument, it also searches for test packages. Welcome making this an optional flag.

@Bobgy Bobgy added enhancement New feature or request help wanted Extra attention is needed labels Apr 11, 2022
blanet added a commit to blanet/go-licenses that referenced this issue Apr 12, 2022
@davidhsingyuchen
Copy link
Contributor

This will be very helpful.

@blanet It seems that you started some experiments with the change, and I'm wondering if you plan to continue working on it. If not, maybe I can take a look at this and credit your work. Thanks!

@blanet
Copy link
Author

blanet commented Oct 19, 2022

@davidhsingyuchen Thansk! Just feel free to go on with my old work if they can help!

@davidhsingyuchen
Copy link
Contributor

@Bobgy Could you help share when a release will be cut to include this feature? Asking here because CONTRIBUTING.md does not seem to mention release process. Thanks!

@Bobgy
Copy link
Collaborator

Bobgy commented Oct 24, 2022

Here you go: https://github.com/google/go-licenses/releases/tag/v1.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants