go-license icon indicating copy to clipboard operation
go-license copied to clipboard

Add ".rst" suffix to the pile

Open client9 opened this issue 8 years ago • 2 comments

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

client9 avatar Oct 18 '15 03:10 client9

https://www.google.com/search?client=safari&rls=en&q=site:github.com+license.rtf&ie=UTF-8&oe=UTF-8

etc.

client9 avatar Oct 18 '15 03:10 client9

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
}

client9 avatar Oct 19 '15 18:10 client9