4 ms·
GitHub already parses README files of various formats. I wonder how hard it would be to just parse a LICENSE/COPYRIGHT file if it's available. This would make s
by phaylon 15y ago
GitHub already parses README files of various formats. I wonder how hard it would be to just parse a LICENSE/COPYRIGHT file if it's available. This would make sure the licenses are distributed with the code. If the license file couldn't be parsed, a "Custom License" link to the corresponding license file could be a good general fallback too.
- technoweenie 15y agoGitHub detects the presence of README files by file name. It'd be pretty easy to do that for LICENSE files too of course. Look for LICENSE, MIT-LICENSE, etc. The trick is actually identifying what type of license it is. Pop quiz: What license is this? https://github.com/sinatra/sinatra/blob/master/LICENSE https://github.com/sinatra/sinatra/blob/master/LICENSE This problem would be perfect for a tiny ruby script like Linguist: https://github.com/github/linguist https://github.com/github/linguist. Just something simple that's given some filenames and contents that can return the license type. It'd also be nice to handle non software licenses, such as creative commons. I'm not sure what the convention is for specifying that in Git repositories, however.
- insertnickname 15y agoThat's the MIT license.
- technomancy 15y agoMIT-X11 license to be precise; MIT has spawned a number of licenses.