-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Suggestion: also detect variations in license-file names in GitHub repos, such as LICENSE.md #460
Comments
Why presume when the source is there? ;) We actually rely on GitHub to give us the correct license. However, if you paste your repo's URL https://github.com/mklement0/make-pkg into the search bar in shields.io and press “Suggest badges”, the correct (static) license badge will show up! Then, click on the badge to be able to copy and paste it into wherever! |
Thanks for pointing me in the right direction. To summarize: my diagnosis was speculative and incorrect; the truth is:
Therefore, I'll go bug the GitHub people about it. (I'm being less speculative here, but I'm still shy about digging into the source myself.) The "Suggest badges" code must be different, because it works for repos that the GitHub-repo-URL-based badges don't work with, and vice versa. I'm looking for a programmatic solution, and it seems (speculation alert) that a license-ID-based badge can be constructed as follows:
E.g., for the BSD-3-Clause license: https://img.shields.io/badge/license-BSD--3--Clause-blue.svg |
Wow, apparently “licence” is not just used in the UK, it is also in use in Canada and Australia! The "Suggest badges” code lies in Custom badges are detailed at the bottom of https://shields.io. You could put https://img.shields.io/badge/licence-BSD--3--Clause-blue.svg (with |
Let's not forget India, South Africa, Singapore ... (Commonwealth of Nations members), "[w]here written English (...) generally favours British as opposed to American spelling, with one notable exception being Canada, where there is also a strong influence from neighbouring American English." [1] Re "Suggest badges” : Thanks for the explanation, that's helpful. Here's one example where the GitHub API succeeds, but your code doesn't. It is admittedly a strange corner case and may not be worth handling: the license file contains the literal text of the BSD-2-Clause with the list numbering removed (and whitespace differences): Re custom badges: Again, good to know, thanks. Looks like I simply created a custom badge and speculatively read special significance into it (non-existent interpretation of an SPDX license ID). What a speculationfest. But festivities are over now. Thanks for all your help. |
It seems that currently only files named
LICENSE
are recognized for GitHub-license badge URLs such as https://img.shields.io/github/license/mklement0/make-pkg.svg.The above badge link is for a repo (of mine) that has a
LICENSE.md
file in lieu ofLICENSE
, which, unfortunately, renders the badge with "unknown license".It would be great if filename variations such as
LICENSE.md
orLICENSE.markdown
were recognized as well.P.S.: Thanks for a great site and service.
The text was updated successfully, but these errors were encountered: