error-chain icon indicating copy to clipboard operation
error-chain copied to clipboard

"license: unknown-license" badge on repository page

Open vi opened this issue 7 years ago • 7 comments

Yet Cargo.toml contains licence field:

license = "MIT/Apache-2.0"

vi avatar Nov 21 '16 15:11 vi

Yeah, I don't know why... Maybe then only check the LICENSE file.

Yamakaky avatar Nov 21 '16 16:11 Yamakaky

That seems to be correct. a) shields seems to use the github API (https://github.com/badges/shields/blob/b74107eb3d4301c192e5dfd6d252e8a3b90d16bf/suggest.js#L36) b) the github API seems to rely on a license file (https://developer.github.com/v3/licenses/#get-a-repositorys-license)

colin-kiegel avatar Nov 21 '16 17:11 colin-kiegel

Also Github seems to show licence in tabs (Example "Apache 2.0" in https://github.com/rust-lang/cargo/ )

3,571 commits 5 branches 17 releases 264 contributors Apache-2.0

making such shields redundant.

vi avatar Nov 21 '16 18:11 vi

Ideally, someone should update github's license detection to look at Cargo metadata too.

joshtriplett avatar Nov 24 '16 00:11 joshtriplett

You can report it to Github feedback page. They have internal issue/feature request tracker and always reply something.

vi avatar Nov 24 '16 01:11 vi

GitHub documentation says they're using the licensee ruby gem. While they do have some heuristics for detecting fields of package managers (e.g. gemspec, bower), licensee appears to recommend just sticking the license text in the repository and not relying upon the field of the package manager. I'm guessing those language ecosystem specific heuristics are a bit old and from a long time ago and are grandfathered in. I don't see CPAN, D, Elm, or really any wide assortment of matchers for ecosystems in their matchers.

Licensee could be updated, but I would wager that the request won't be accepted.

nelsonjchen avatar Dec 29 '16 00:12 nelsonjchen

Or... maybe they do. I guess I just wasn't looking hard enough. That said, they do say the R people explicitly recommend not including the license text.

https://github.com/benbalter/licensee/pull/129

nelsonjchen avatar Dec 29 '16 00:12 nelsonjchen