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

Detect licenses names like MIT-LICENSE.txt #142

Open
silverwind opened this issue Sep 3, 2022 · 4 comments
Open

Detect licenses names like MIT-LICENSE.txt #142

silverwind opened this issue Sep 3, 2022 · 4 comments

Comments

@silverwind
Copy link

silverwind commented Sep 3, 2022

https://github.com/mrjones/oauth has a MIT-LICENSE.txt in its root but it's currently not detected:

E0903 20:40:47.315979   75355 library.go:115] Failed to find license for github.com/mrjones/oauth: cannot find a known open source license for "/go/pkg/mod/github.com/mrjones/oauth@v0.0.0-20190623134757-126b35219450" whose name matches regexp ^(?i)((UN)?LICEN(S|C)E|COPYING|README|NOTICE).*$ and locates up until "/go/pkg/mod/github.com/mrjones/oauth@v0.0.0-20190623134757-126b35219450"

Maybe the ^ should be removed from the regex.

@Bobgy
Copy link
Collaborator

Bobgy commented Sep 6, 2022

We may need to split up to multiple regex patterns. For some, it doesn't make sense to remove the ^.

PR welcomed!

@silverwind
Copy link
Author

silverwind commented Sep 6, 2022

FWIW, Github does detect the license correctly on that repo. Maybe their code that does it is open-source, not sure.

Edit: It is https://github.com/licensee/licensee as per this. It uses a scoring system with multiple regexes.

@Bobgy
Copy link
Collaborator

Bobgy commented Sep 7, 2022

Be careful with directly using other open source project's code, there are license issues.

It's good to know someone else also uses multiple patterns.

To add to that, the patterns can have different confidence level. If a file named LICENSE doesn't have a recognized license, we should raise an error. But if a file abcd-licenser.txt doesn't have license content, we can log a debug message instead.

Current behavior: we check for all files matching the regex, but we don't log an error at all for individual files.

@silverwind
Copy link
Author

Asked the author to rename in mrjones/oauth#74.

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