-
Notifications
You must be signed in to change notification settings - Fork 116
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 --ignore option #46
Conversation
Tested this, and it seems to work Ok. I would perhaps have preferred a way to ignore 1st-party packages instead (packages in module being scanned), but this approach is more flexible, and makes this possible by ignoring module name |
What about this pull request? Looks really good. |
Any updates here? |
plz merge. I need this, too |
Packages beginning with the specified path will be ignored. Imported packages by ignored packages are still checked.
93f9da6
to
c33c0e6
Compare
Hi people, I'm a new maintainer for go-licenses now. From the number of comments and thumb ups, I can see that this is requested by a lot. My main concerns for merging this is that -- IMO, such kind of configurations likely grow in size, e.g. people may also need to override some packages with non-auto detectable licenses, so I want to make sure the current proposed argument syntax is compatible with that future use-case. To my knowledge and suggested by @drigz, viper is a good option to allow configuring from both a command line argument and a config file symmetrically. Therefore, I just want to confirm the option's array syntax is compatible with cobra and viper. |
https://go.dev/play/p/QCK8-GwWV82 I didn't noticed there is |
I'm using my branch of go-licenses for more than a year in my company's product repositories to check all external dependencies have proper license. In this kind of closed project use cases,
In open source project use cases, above with (*) may be chosen. |
Thanks for simplifying with StringSlice! IMO supporting a config file is out-of-scope of this PR but if needed in future, Viper should support this (judging from status of spf13/viper#200). |
Another possibility is that the license is too complex for go-licenses -- dual licenses, more than one licenses etc. So we need human intervention. This is where I think the config may grow.
Agreed with everything else! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! The simplified PR looks great!
Only some nitpickings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a section in https://github.com/google/go-licenses/blob/master/README.md to introduce this new feature?
Added a section to introduce the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfect! Thank you for this great contribution!
cc @drigz do you want to have another look?
Also cc @wlynch, do you want to have a look? |
LGTM |
Fixes #88
Packages beginning with the specified path will be ignored.
Imported packages by ignored packages are still checked.
In my case, I would like to use go-licenses to check library licenses used in our product system.
--ignore
will be used to ignore internal private packages with proprietary license.