GitHub correctly AND incorrectly detecting LICENSE

Hey there :wave: First topic. I hope it’s not the wrong place to post this.

I am also sorry for ugly formatting on the links, but there is a certain restriction to new users.

This example repository has the apache 2 license. It shows correctly when searching GitHub for it (see here: github [dot] com/search?q=archisteamfarm ). When opening the “community” page under “Insights” (see here: github [dot] com/JustArchiNET/ArchiSteamFarm/community ), GitHub proposes to add a license. I’ve added two screenshots to show it without clicking the links: no screenshots due to new user limit.

It’s probably due to the “2.0” in the license file name. Detecting a license describes that GitHub uses Licensee for detection, and this file there has more details:

It’s probably due to the “2.0” in the license file name

Probably. But this is mostly about consinstency. It’s already detected correctly and the other “component” of the github ecosystem should be able to make use of that information IMO.

It’s definitely that. The consistency argument could be turned the other way around too: for consistency sake, al license files should be just named LICENSE (or COPYING. for those licenses that are customary to adopt that name).

The GH license detection system is quite rigid though, e.g. if you add an extra line after the Copyright notice in the MIT License (e.g. after author name and email, adding a link to the author’s or project website/repository), the license won’t be auto-detected. In these cases, it’s up to you to decide whether you prefer to keep a detailed license info or sacrifice it for the auto-detect feature.

I personally prefer to focus on the license details, and there’s nothing wrong with adding the repository link after the author in the MIT License (you have quite some freedom when it comes to what info you can add, as long as you don’t omit any of the required text).

In any case, the license auto-detection system also fails in projects with multiple LICENSE files (e.g. due to third party components in some sub-folder having their own LICENSE file).

I’m not sure how GitHub handle the SPDX standard for licenses, but this would definitely be nice if supported:

1 Like