Open client9 opened 9 years ago
FWIW, In another project, I just ignore the filename suffix to produce a list of candidates.
Seems to be ok.
// LicenseFilePrefix is a list of filename prefixes that indicate it
// might contain a software license
var LicenseFilePrefix = []string{
"license",
"copying",
"unlicensed",
//Mine has "copyright" and "copyleft" too
}
// IsPossibleLicenseFile returns true if the filename might be contain a software license
func IsPossibleLicenseFile(filename string) bool {
lowerfile := strings.ToLower(filename)
for _, prefix := range LicenseFilePrefix {
if strings.HasPrefix(lowerfile, prefix) {
return true
}
}
return false
}
https://en.wikipedia.org/wiki/ReStructuredText
https://www.google.com/search?client=safari&rls=en&q=site:github.com+copyleft&ie=UTF-8&oe=UTF-8#q=site:github.com+license.rst
site:github.com copying.st
etc