├── assets └── database │ ├── .gititgnore │ ├── .gitignore │ ├── .ignore │ ├── build_database_test.go │ ├── licenses │ ├── diffmark.json │ ├── dvipdfm.json │ ├── FSFUL.json │ ├── FSFAP.json │ ├── Beerware.json │ ├── Zed.json │ ├── Dotseqn.json │ ├── FSFULLR.json │ ├── blessing.json │ ├── Fair.json │ ├── NLPL.json │ ├── ADSL.json │ ├── Glulxe.json │ ├── Crossword.json │ ├── SSH-short.json │ ├── WTFPL.json │ ├── psfrag.json │ ├── Barr.json │ ├── Wsuipa.json │ ├── GPL-2.0-with-GCC-exception.json │ ├── Newsletr.json │ ├── GPL-2.0-with-font-exception.json │ ├── APAFML.json │ ├── HaskellReport.json │ ├── XSkat.json │ ├── TCP-wrappers.json │ ├── 0BSD.json │ ├── Borceux.json │ ├── Latex2e.json │ ├── Abstyles.json │ ├── GPL-2.0-with-bison-exception.json │ ├── Spencer-86.json │ ├── TU-Berlin-1.0.json │ ├── NTP.json │ ├── NTP-0.json │ ├── Fair-Source-0.9.json │ ├── IBM-pibs.json │ ├── MirOS.json │ ├── Xerox.json │ ├── Leptonica.json │ ├── GPL-2.0-with-classpath-exception.json │ ├── RSA-MD.json │ ├── CrystalStacker.json │ ├── Afmparse.json │ ├── GL2PS.json │ ├── ANTLR-PD.json │ ├── MIT-feh.json │ ├── Rdisc.json │ ├── curl.json │ ├── libselinux-1.0.json │ ├── ISC.json │ ├── Zlib.json │ ├── EFL-1.0.json │ ├── Noweb.json │ ├── Spencer-94.json │ ├── JSON.json │ ├── libtiff.json │ ├── Linux-OpenIB.json │ ├── MIT-0.json │ ├── EFL-2.0.json │ ├── SMLNJ.json │ ├── StandardML-NJ.json │ ├── Nunit.json │ └── Unlicense.json │ ├── bsd_extra.go │ └── README.md ├── .ignore ├── vendor ├── github.com │ ├── spf13 │ │ ├── pflag │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ └── LICENSE │ │ └── cobra │ │ │ ├── command_notwin.go │ │ │ ├── .mailmap │ │ │ ├── .travis.yml │ │ │ ├── command_win.go │ │ │ ├── .gitignore │ │ │ ├── fish_completions.md │ │ │ ├── powershell_completions.md │ │ │ ├── Makefile │ │ │ └── zsh_completions.md │ ├── boyter │ │ └── gocodewalker │ │ │ ├── .ignore │ │ │ ├── go-gitignore │ │ │ ├── errors.go │ │ │ ├── doc.go │ │ │ ├── rune.go │ │ │ ├── tokenset.go │ │ │ ├── tokentype.go │ │ │ ├── error.go │ │ │ ├── match.go │ │ │ ├── position.go │ │ │ ├── exclude.go │ │ │ ├── LICENSE │ │ │ ├── token.go │ │ │ └── cache.go │ │ │ ├── hidden.go │ │ │ ├── .gitignore │ │ │ ├── hidden_windows.go │ │ │ ├── .goreleaser.yml │ │ │ ├── LICENSE │ │ │ ├── UNLICENSE │ │ │ └── check.sh │ ├── BobuSumisu │ │ └── aho-corasick │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── match.go │ │ │ └── trie.go │ ├── tealeg │ │ └── xlsx │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── doc.go │ │ │ ├── row.go │ │ │ ├── xmlSharedStrings.go │ │ │ ├── col.go │ │ │ ├── theme.go │ │ │ ├── xmlTheme.go │ │ │ ├── AUTHORS.txt │ │ │ ├── xmlContentTypes.go │ │ │ └── reftable.go │ ├── danwakefield │ │ └── fnmatch │ │ │ ├── README.md │ │ │ ├── .gitignore │ │ │ └── LICENSE │ ├── inconshreveable │ │ └── mousetrap │ │ │ ├── trap_others.go │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── trap_windows_1.4.go │ └── texttheater │ │ └── golang-levenshtein │ │ └── LICENSE ├── golang.org │ └── x │ │ └── sync │ │ ├── errgroup │ │ ├── go120.go │ │ └── pre_go120.go │ │ ├── PATENTS │ │ └── LICENSE └── modules.txt ├── parsers ├── README.md ├── structs.go └── formatter_test.go ├── .travis.yml ├── generate_database.sh ├── .gitignore ├── .github └── workflows │ └── go.yml ├── go.mod ├── Gopkg.toml ├── processor ├── guesser_vectorspace.go ├── vectorspace.go ├── structs.go ├── guesser_full_test.go ├── guesser_blended.go ├── common_test.go ├── guesser.go └── common.go ├── CONTRIBUTING.md ├── scripts └── include.go ├── NOTES.md ├── main.go ├── check.sh └── Gopkg.lock /assets/database/.gititgnore: -------------------------------------------------------------------------------- 1 | database -------------------------------------------------------------------------------- /.ignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | database_keywords.json -------------------------------------------------------------------------------- /assets/database/.gitignore: -------------------------------------------------------------------------------- 1 | database_keywords.json -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /assets/database/.ignore: -------------------------------------------------------------------------------- 1 | licenses 2 | database_keywords.json -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/.ignore: -------------------------------------------------------------------------------- 1 | / 2 | go-gitignore -------------------------------------------------------------------------------- /vendor/github.com/BobuSumisu/aho-corasick/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - master 5 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .DS_Store 3 | xlsx.test 4 | *.swp 5 | coverage.txt 6 | -------------------------------------------------------------------------------- /parsers/README.md: -------------------------------------------------------------------------------- 1 | This is the old code that is being slowly moved away from. Eventually everything in here will be deleted. -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package cobra 4 | 5 | var preExecHookFn func(*Command) 6 | -------------------------------------------------------------------------------- /vendor/github.com/danwakefield/fnmatch/README.md: -------------------------------------------------------------------------------- 1 | # fnmatch 2 | Updated clone of kballards golang fnmatch gist (https://gist.github.com/kballard/272720) 3 | 4 | 5 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.mailmap: -------------------------------------------------------------------------------- 1 | Steve Francia 2 | Bjørn Erik Pedersen 3 | Fabiano Franz 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | os: 3 | - linux 4 | - osx 5 | go: 6 | - 1.10.x 7 | env: 8 | - GOOS=windows GOARCH=amd64 9 | - GOOS=linux GOARCH=amd64 10 | - GOOS=linux GOARCH=386 11 | - GOOS=linux GOARCH=arm 12 | matrix: 13 | fast_finish: true 14 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | install: 4 | - go get -d -t -v ./... && go build -v ./... 5 | 6 | go: 7 | - 1.5 8 | - 1.6 9 | - 1.7 10 | - 1.8 11 | - tip 12 | 13 | script: 14 | - go vet ./... 15 | - go test -v -coverprofile=coverage.txt -covermode=atomic 16 | 17 | after_success: 18 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/errors.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | var ( 10 | CarriageReturnError = errors.New("unexpected carriage return '\\r'") 11 | InvalidPatternError = errors.New("invalid pattern") 12 | InvalidDirectoryError = errors.New("invalid directory") 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/hidden.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | //go:build !windows 3 | // +build !windows 4 | 5 | package gocodewalker 6 | 7 | import ( 8 | "os" 9 | ) 10 | 11 | // IsHidden Returns true if file is hidden 12 | func IsHidden(file os.FileInfo, directory string) (bool, error) { 13 | return file.Name()[0:1] == ".", nil 14 | } 15 | -------------------------------------------------------------------------------- /generate_database.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "building the database..." 4 | pushd ./assets/database/ || exit 5 | go build 6 | ./database 7 | popd || exit 8 | 9 | echo "copying the database..." 10 | cp ./assets/database/database_keywords.json . 11 | 12 | echo "running go generate..." 13 | go generate 14 | 15 | echo "running all tests to see how it went..." 16 | go test -v ./... 17 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | - 1.11.x 9 | - tip 10 | 11 | matrix: 12 | allow_failures: 13 | - go: tip 14 | 15 | install: 16 | - go get golang.org/x/lint/golint 17 | - export PATH=$GOPATH/bin:$PATH 18 | - go install ./... 19 | 20 | script: 21 | - verify/all.sh -v 22 | - go test ./... 23 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .idea 18 | dist/ 19 | -------------------------------------------------------------------------------- /vendor/github.com/danwakefield/fnmatch/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | return context.WithCancelCause(parent) 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | lc 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 15 | .glide/ 16 | 17 | # IDEA 18 | .idea 19 | 20 | # Accuracy + Benchmarks 21 | /assets/accuracy/ -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/doc.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | /* 4 | Package gitignore provides an interface for parsing .gitignore files, 5 | either individually, or within a repository, and 6 | matching paths against the retrieved patterns. Path matching is done using 7 | fnmatch as specified by git (see https://git-scm.com/docs/gitignore), with 8 | support for recursive matching via the "**" pattern. 9 | */ 10 | package gitignore 11 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/rune.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | const ( 6 | // define the sentinel runes of the lexer 7 | _EOF = rune(0) 8 | _CR = rune('\r') 9 | _NEWLINE = rune('\n') 10 | _COMMENT = rune('#') 11 | _SEPARATOR = rune('/') 12 | _ESCAPE = rune('\\') 13 | _SPACE = rune(' ') 14 | _TAB = rune('\t') 15 | _NEGATION = rune('!') 16 | _WILDCARD = rune('*') 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/doc.go: -------------------------------------------------------------------------------- 1 | // xslx is a package designed to help with reading data from 2 | // spreadsheets stored in the XLSX format used in recent versions of 3 | // Microsoft's Excel spreadsheet. 4 | // 5 | // Additionally, xlsx has started to grow some XLSX authoring 6 | // capabilities too. 7 | // 8 | // For a concise example of how to use this library why not check out 9 | // the source for xlsx2csv here: https://github.com/tealeg/xlsx2csv 10 | 11 | package xlsx 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/pre_go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | ctx, cancel := context.WithCancel(parent) 13 | return ctx, func(error) { cancel() } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: Go 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v2 18 | with: 19 | go-version: 1.17 20 | 21 | - name: Build 22 | run: go build -v ./... 23 | 24 | - name: Test 25 | run: go test -v ./... 26 | -------------------------------------------------------------------------------- /assets/database/build_database_test.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package main 4 | 5 | import ( 6 | "testing" 7 | ) 8 | 9 | func TestNgamOne(t *testing.T) { 10 | ngrams := findNgrams([]string{"1", "2", "3", "4"}, 1) 11 | 12 | if len(ngrams) != 4 { 13 | t.Errorf("should be 4") 14 | } 15 | } 16 | 17 | func TestNgamThree(t *testing.T) { 18 | ngrams := findNgrams([]string{"1", "2", "3", "4"}, 3) 19 | 20 | if len(ngrams) != 2 { 21 | t.Errorf("should be 2") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/tokenset.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | // tokenset represents an ordered list of Tokens 6 | type tokenset []*Token 7 | 8 | // String() returns a concatenated string of all runes represented by the 9 | // list of tokens. 10 | func (t tokenset) String() string { 11 | // concatenate the tokens into a single string 12 | _rtn := "" 13 | for _, _t := range []*Token(t) { 14 | _rtn = _rtn + _t.Token() 15 | } 16 | return _rtn 17 | } // String() 18 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | stages: 4 | - diff 5 | - test 6 | - build 7 | 8 | go: 9 | - 1.12.x 10 | - 1.13.x 11 | - tip 12 | 13 | before_install: 14 | - go get -u github.com/kyoh86/richgo 15 | - go get -u github.com/mitchellh/gox 16 | 17 | matrix: 18 | allow_failures: 19 | - go: tip 20 | include: 21 | - stage: diff 22 | go: 1.13.x 23 | script: make fmt 24 | - stage: build 25 | go: 1.13.x 26 | script: make cobra_generator 27 | 28 | script: 29 | - make test 30 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/boyter/lc 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/BobuSumisu/aho-corasick v1.0.3 7 | github.com/boyter/gocodewalker v1.3.3 8 | github.com/spf13/cobra v1.0.0 9 | github.com/tealeg/xlsx v1.0.3 10 | github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e 11 | ) 12 | 13 | require ( 14 | github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect 15 | github.com/inconshreveable/mousetrap v1.0.0 // indirect 16 | github.com/spf13/pflag v1.0.5 // indirect 17 | golang.org/x/sync v0.7.0 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package cobra 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "time" 9 | 10 | "github.com/inconshreveable/mousetrap" 11 | ) 12 | 13 | var preExecHookFn = preExecHook 14 | 15 | func preExecHook(c *Command) { 16 | if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { 17 | c.Print(MousetrapHelpText) 18 | if MousetrapDisplayDuration > 0 { 19 | time.Sleep(MousetrapDisplayDuration) 20 | } else { 21 | c.Println("Press return to continue...") 22 | fmt.Scanln() 23 | } 24 | os.Exit(1) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/row.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | type Row struct { 4 | Cells []*Cell 5 | Hidden bool 6 | Sheet *Sheet 7 | Height float64 8 | OutlineLevel uint8 9 | isCustom bool 10 | } 11 | 12 | func (r *Row) SetHeight(ht float64) { 13 | r.Height = ht 14 | r.isCustom = true 15 | } 16 | 17 | func (r *Row) SetHeightCM(ht float64) { 18 | r.Height = ht * 28.3464567 // Convert CM to postscript points 19 | r.isCustom = true 20 | } 21 | 22 | func (r *Row) AddCell() *Cell { 23 | cell := NewCell(r) 24 | r.Cells = append(r.Cells, cell) 25 | r.Sheet.maybeAddCol(len(r.Cells)) 26 | return cell 27 | } 28 | -------------------------------------------------------------------------------- /assets/database/licenses/diffmark.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "\n\n 1. you can do what you want with it\n\n 2. I refuse any responsibility for the consequences", 4 | "standardLicenseTemplate": "\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e you can do what you want with it\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.\";match\u003d\".{0,20}\"\u003e\u003e I refuse any responsibility for the consequences", 5 | "name": "diffmark license", 6 | "licenseId": "diffmark", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/diffmark" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore 23 | # swap 24 | [._]*.s[a-w][a-z] 25 | [._]s[a-w][a-z] 26 | # session 27 | Session.vim 28 | # temporary 29 | .netrwhist 30 | *~ 31 | # auto-generated tag files 32 | tags 33 | 34 | *.exe 35 | cobra.test 36 | bin 37 | 38 | .idea/ 39 | *.iml 40 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/hidden_windows.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | //go:build windows 3 | // +build windows 4 | 5 | package gocodewalker 6 | 7 | import ( 8 | "os" 9 | "path" 10 | "syscall" 11 | ) 12 | 13 | // IsHidden Returns true if file is hidden 14 | func IsHidden(file os.FileInfo, directory string) (bool, error) { 15 | fullpath := path.Join(directory, file.Name()) 16 | pointer, err := syscall.UTF16PtrFromString(fullpath) 17 | if err != nil { 18 | return false, err 19 | } 20 | attributes, err := syscall.GetFileAttributes(pointer) 21 | if err != nil { 22 | return false, err 23 | } 24 | return attributes&syscall.FILE_ATTRIBUTE_HIDDEN != 0, nil 25 | } 26 | -------------------------------------------------------------------------------- /assets/database/licenses/dvipdfm.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "A modified version of this file may be distributed, but it should be distributed with a *different* name. Changed files must be distributed *together with a complete and unchanged* distribution of these files.", 4 | "standardLicenseTemplate": "A modified version of this file may be distributed, but it should be distributed with a *different* name. Changed files must be distributed *together with a complete and unchanged* distribution of these files.", 5 | "name": "dvipdfm License", 6 | "licenseId": "dvipdfm", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/dvipdfm" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/fish_completions.md: -------------------------------------------------------------------------------- 1 | ## Generating Fish Completions for your own cobra.Command 2 | 3 | Cobra supports native Fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. 4 | 5 | ### Limitations 6 | 7 | * Custom completions implemented using the `ValidArgsFunction` and `RegisterFlagCompletionFunc()` are supported automatically but the ones implemented in Bash scripting are not. 8 | -------------------------------------------------------------------------------- /assets/database/licenses/FSFUL.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.\n\nThis configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it.", 5 | "name": "FSF Unlimited License", 6 | "licenseId": "FSFUL", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/FSF_Unlimited_License" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/FSFAP.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "isFsfLibre": true, 4 | "licenseText": "Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.", 5 | "standardLicenseTemplate": "Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.", 6 | "name": "FSF All Permissive License", 7 | "licenseId": "FSFAP", 8 | "seeAlso": [ 9 | "https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/powershell_completions.md: -------------------------------------------------------------------------------- 1 | # Generating PowerShell Completions For Your Own cobra.Command 2 | 3 | Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. 4 | 5 | # What's supported 6 | 7 | - Completion for subcommands using their `.Short` description 8 | - Completion for non-hidden flags using their `.Name` and `.Shorthand` 9 | 10 | # What's not yet supported 11 | 12 | - Command aliases 13 | - Required, filename or custom flags (they will work like normal flags) 14 | - Custom completion scripts 15 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | [prune] 28 | go-tests = true 29 | unused-packages = true 30 | 31 | [[constraint]] 32 | name = "github.com/tealeg/xlsx" 33 | version = "1.0.3" 34 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/tokentype.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | type TokenType int 6 | 7 | const ( 8 | ILLEGAL TokenType = iota 9 | EOF 10 | EOL 11 | WHITESPACE 12 | COMMENT 13 | SEPARATOR 14 | NEGATION 15 | PATTERN 16 | ANY 17 | BAD 18 | ) 19 | 20 | // String returns a string representation of the Token type. 21 | func (t TokenType) String() string { 22 | switch t { 23 | case ILLEGAL: 24 | return "ILLEGAL" 25 | case EOF: 26 | return "EOF" 27 | case EOL: 28 | return "EOL" 29 | case WHITESPACE: 30 | return "WHITESPACE" 31 | case COMMENT: 32 | return "COMMENT" 33 | case SEPARATOR: 34 | return "SEPARATOR" 35 | case NEGATION: 36 | return "NEGATION" 37 | case PATTERN: 38 | return "PATTERN" 39 | case ANY: 40 | return "ANY" 41 | default: 42 | return "BAD TOKEN" 43 | } 44 | } // String() 45 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/.goreleaser.yml: -------------------------------------------------------------------------------- 1 | # This is an example .goreleaser.yml file with some sensible defaults. 2 | # Make sure to check the documentation at https://goreleaser.com 3 | before: 4 | hooks: 5 | # You may remove this if you don't use go modules. 6 | - go mod tidy 7 | # you may remove this if you don't need go generate 8 | - go generate ./... 9 | builds: 10 | - env: 11 | - CGO_ENABLED=0 12 | goos: 13 | - linux 14 | - windows 15 | - darwin 16 | archives: 17 | - replacements: 18 | darwin: Darwin 19 | linux: Linux 20 | windows: Windows 21 | 386: i386 22 | amd64: x86_64 23 | checksum: 24 | name_template: 'checksums.txt' 25 | snapshot: 26 | name_template: "{{ incpatch .Version }}-next" 27 | changelog: 28 | sort: asc 29 | filters: 30 | exclude: 31 | - '^docs:' 32 | - '^test:' 33 | -------------------------------------------------------------------------------- /assets/database/licenses/Beerware.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "\"THE BEER-WARE LICENSE\" (Revision 42):\n\n\u003cphk@FreeBSD.ORG\u003e wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp", 4 | "standardLicenseTemplate": "\"THE BEER-WARE LICENSE\" (Revision 42):\n\n\u003cphk@FreeBSD.ORG\u003e wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp", 5 | "name": "Beerware License", 6 | "licenseId": "Beerware", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Beerware", 9 | "https://people.freebsd.org/~phk/" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /assets/database/licenses/Zed.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "(c) Jim Davies, January 1995\n\nYou may copy and distribute this file freely. Any queries and complaints should be forwarded to Jim.Davies@comlab.ox.ac.uk.\n\nIf you make any changes to this file, please do not distribute the results under the name `zed-csp.sty\u0027.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"(c) Jim Davies, January 1995\";match\u003d\".{0,1000}\"\u003e\u003e\n\nYou may copy and distribute this file freely. Any queries and complaints should be forwarded to Jim.Davies@comlab.ox.ac.uk.\n\nIf you make any changes to this file, please do not distribute the results under the name `zed-csp.sty\u0027.", 5 | "name": "Zed License", 6 | "licenseId": "Zed", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Zed" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/error.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | type Error interface { 6 | error 7 | 8 | // Position returns the position of the error within the .gitignore file 9 | // (if any) 10 | Position() Position 11 | 12 | // Underlying returns the underlying error, permitting direct comparison 13 | // against the wrapped error. 14 | Underlying() error 15 | } 16 | 17 | type err struct { 18 | error 19 | _position Position 20 | } // err() 21 | 22 | // NewError returns a new Error instance for the given error e and position p. 23 | func NewError(e error, p Position) Error { 24 | return &err{error: e, _position: p} 25 | } // NewError() 26 | 27 | func (e *err) Position() Position { return e._position } 28 | 29 | func (e *err) Underlying() error { return e.error } 30 | 31 | // ensure err satisfies the Error interface 32 | var _ Error = &err{} 33 | -------------------------------------------------------------------------------- /assets/database/licenses/Dotseqn.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (C) 1995 by Donald Arseneau\n\nThis file may be freely transmitted and reproduced, but it may not be changed unless the name is changed also (except that you may freely change the paper-size option for \\documentclass).\n\nThis notice must be left intact.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 1995 by Donald Arseneau\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis file may be freely transmitted and reproduced, but it may not be changed unless the name is changed also (except that you may freely change the paper-size option for \\documentclass).\n\nThis notice must be left intact.", 5 | "name": "Dotseqn License", 6 | "licenseId": "Dotseqn", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Dotseqn" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/FSFULLR.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright 1996-2006 Free Software Foundation, Inc.\n\nThis file is free software; the Free Software Foundation gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright 1996-2006 Free Software Foundation, Inc.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis file is free software; the Free Software Foundation gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved.", 5 | "name": "FSF Unlimited License (with License Retention)", 6 | "licenseId": "FSFULLR", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/FSF_Unlimited_License#License_Retention_Variant" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/blessing.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "The author disclaims copyright to this source code. In place of a legal notice, here is a blessing:\n\n \n\n May you do good and not evil.\n\n \n\n May you find forgiveness for yourself and forgive others.\n\n \n\n May you share freely, never taking more than you give.", 4 | "standardLicenseTemplate": "The author disclaims copyright to this source code. In place of a legal notice, here is a blessing:\n\n \n\n May you do good and not evil.\n\n \n\n May you find forgiveness for yourself and forgive others.\n\n \n\n May you share freely, never taking more than you give.", 5 | "name": "SQLite Blessing", 6 | "licenseId": "blessing", 7 | "seeAlso": [ 8 | "https://www.sqlite.org/src/artifact/e33a4df7e32d742a?ln\u003d4-9", 9 | "https://sqlite.org/src/artifact/df5091916dbb40e6" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /processor/guesser_vectorspace.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package processor 4 | 5 | import ( 6 | "sort" 7 | "strings" 8 | ) 9 | 10 | func (l *LicenceGuesser) VectorSpaceGuessLicence(content []byte) []License { 11 | var matchingLicenses []License 12 | 13 | con := BuildConcordance(strings.Split(LcCleanText(string(content)), " ")) 14 | 15 | // Swap out the database to the full one if configured to use it 16 | db := l.CommonDatabase 17 | if l.UseFullDatabase { 18 | db = l.Database 19 | } 20 | 21 | for _, lic := range db { 22 | distance := Relation(con, lic.Concordance) 23 | lic.ScorePercentage = distance * 100 24 | lic.MatchType = MatchTypeVector 25 | matchingLicenses = append(matchingLicenses, lic) 26 | } 27 | 28 | sort.Slice(matchingLicenses, func(i, j int) bool { 29 | return matchingLicenses[i].ScorePercentage > matchingLicenses[j].ScorePercentage 30 | }) 31 | 32 | return matchingLicenses 33 | } 34 | -------------------------------------------------------------------------------- /processor/vectorspace.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package processor 4 | 5 | import ( 6 | "math" 7 | ) 8 | 9 | type Concordance map[string]float64 10 | 11 | func (con Concordance) magnitude() float64 { 12 | total := 0.0 13 | 14 | for _, v := range con { 15 | total = total + math.Pow(v, 2) 16 | } 17 | 18 | return math.Sqrt(total) 19 | } 20 | 21 | func BuildConcordance(words []string) Concordance { 22 | con := map[string]float64{} 23 | 24 | for _, key := range words { 25 | con[key] = con[key] + 1 26 | } 27 | 28 | return con 29 | } 30 | 31 | func Relation(con1 Concordance, con2 Concordance) float64 { 32 | topValue := 0.0 33 | 34 | for name, count := range con1 { 35 | _, ok := con2[name] 36 | 37 | if ok { 38 | topValue = topValue + (count * con2[name]) 39 | } 40 | } 41 | 42 | mag := con1.magnitude() * con2.magnitude() 43 | 44 | if mag != 0 { 45 | return topValue / mag 46 | } 47 | 48 | return 0 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/README.md: -------------------------------------------------------------------------------- 1 | # mousetrap 2 | 3 | mousetrap is a tiny library that answers a single question. 4 | 5 | On a Windows machine, was the process invoked by someone double clicking on 6 | the executable file while browsing in explorer? 7 | 8 | ### Motivation 9 | 10 | Windows developers unfamiliar with command line tools will often "double-click" 11 | the executable for a tool. Because most CLI tools print the help and then exit 12 | when invoked without arguments, this is often very frustrating for those users. 13 | 14 | mousetrap provides a way to detect these invocations so that you can provide 15 | more helpful behavior and instructions on how to run the CLI tool. To see what 16 | this looks like, both from an organizational and a technical perspective, see 17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ 18 | 19 | ### The interface 20 | 21 | The library exposes a single interface: 22 | 23 | func StartedByExplorer() (bool) 24 | -------------------------------------------------------------------------------- /assets/database/licenses/Fair.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Fair License \u003cCopyright Information\u003e\n\nUsage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.\n\nDISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e Fair License\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"\u003cCopyright Information\u003e\";match\u003d\".{0,1000}\"\u003e\u003e\n\nUsage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.\n\nDISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.", 5 | "name": "Fair License", 6 | "licenseId": "Fair", 7 | "seeAlso": [ 8 | "http://fairlicense.org/", 9 | "https://opensource.org/licenses/Fair" 10 | ], 11 | "isOsiApproved": true 12 | } -------------------------------------------------------------------------------- /vendor/modules.txt: -------------------------------------------------------------------------------- 1 | # github.com/BobuSumisu/aho-corasick v1.0.3 2 | ## explicit; go 1.14 3 | github.com/BobuSumisu/aho-corasick 4 | # github.com/boyter/gocodewalker v1.3.3 5 | ## explicit; go 1.20 6 | github.com/boyter/gocodewalker 7 | github.com/boyter/gocodewalker/go-gitignore 8 | # github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 9 | ## explicit 10 | github.com/danwakefield/fnmatch 11 | # github.com/inconshreveable/mousetrap v1.0.0 12 | ## explicit 13 | github.com/inconshreveable/mousetrap 14 | # github.com/spf13/cobra v1.0.0 15 | ## explicit; go 1.12 16 | github.com/spf13/cobra 17 | # github.com/spf13/pflag v1.0.5 18 | ## explicit; go 1.12 19 | github.com/spf13/pflag 20 | # github.com/tealeg/xlsx v1.0.3 21 | ## explicit 22 | github.com/tealeg/xlsx 23 | # github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e 24 | ## explicit 25 | github.com/texttheater/golang-levenshtein/levenshtein 26 | # golang.org/x/sync v0.7.0 27 | ## explicit; go 1.18 28 | golang.org/x/sync/errgroup 29 | -------------------------------------------------------------------------------- /parsers/structs.go: -------------------------------------------------------------------------------- 1 | package parsers 2 | 3 | import ( 4 | "path/filepath" 5 | ) 6 | 7 | type License struct { 8 | Keywords []string `json:"keywords"` 9 | LicenseText string `json:"licenseText"` 10 | Name string `json:"name"` 11 | LicenseId string `json:"licenseId"` 12 | } 13 | 14 | type LicenseMatch struct { 15 | LicenseId string 16 | Score float64 17 | } 18 | 19 | type FileResult struct { 20 | Directory string 21 | Filename string 22 | LicenseGuesses []LicenseMatch 23 | LicenseRoots []LicenseMatch 24 | LicenseIdentified []LicenseMatch 25 | Md5Hash string 26 | Sha1Hash string 27 | Sha256Hash string 28 | BytesHuman string 29 | Bytes int 30 | } 31 | 32 | type File struct { 33 | Directory string 34 | File string 35 | RootLicenses []LicenseMatch 36 | LicenseGuesses []LicenseMatch 37 | } 38 | 39 | func (c *FileResult) FullPath() string { 40 | return filepath.Join(c.Directory, c.Filename) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/match.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | // Match represents the interface of successful matches against a .gitignore 6 | // pattern set. A Match can be queried to determine whether the matched path 7 | // should be ignored or included (i.e. was the path matched by a negated 8 | // pattern), and to extract the position of the pattern within the .gitignore, 9 | // and a string representation of the pattern. 10 | type Match interface { 11 | // Ignore returns true if the match pattern describes files or paths that 12 | // should be ignored. 13 | Ignore() bool 14 | 15 | // Include returns true if the match pattern describes files or paths that 16 | // should be included. 17 | Include() bool 18 | 19 | // String returns a string representation of the matched pattern. 20 | String() string 21 | 22 | // Position returns the position in the .gitignore file at which the 23 | // matching pattern was defined. 24 | Position() Position 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/position.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | // Position represents the position of the .gitignore parser, and the position 10 | // of a .gitignore pattern within the parsed stream. 11 | type Position struct { 12 | File string 13 | Line int 14 | Column int 15 | Offset int 16 | } 17 | 18 | // String returns a string representation of the current position. 19 | func (p Position) String() string { 20 | _prefix := "" 21 | if p.File != "" { 22 | _prefix = p.File + ": " 23 | } 24 | 25 | if p.Line == 0 { 26 | return fmt.Sprintf("%s+%d", _prefix, p.Offset) 27 | } else if p.Column == 0 { 28 | return fmt.Sprintf("%s%d", _prefix, p.Line) 29 | } else { 30 | return fmt.Sprintf("%s%d:%d", _prefix, p.Line, p.Column) 31 | } 32 | } // String() 33 | 34 | // Zero returns true if the Position represents the zero Position 35 | func (p Position) Zero() bool { 36 | return p.Line+p.Column+p.Offset == 0 37 | } // Zero() 38 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/Makefile: -------------------------------------------------------------------------------- 1 | BIN="./bin" 2 | SRC=$(shell find . -name "*.go") 3 | 4 | ifeq (, $(shell which richgo)) 5 | $(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo") 6 | endif 7 | 8 | .PHONY: fmt vet test cobra_generator install_deps clean 9 | 10 | default: all 11 | 12 | all: fmt vet test cobra_generator 13 | 14 | fmt: 15 | $(info ******************** checking formatting ********************) 16 | @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) 17 | 18 | test: install_deps vet 19 | $(info ******************** running tests ********************) 20 | richgo test -v ./... 21 | 22 | cobra_generator: install_deps 23 | $(info ******************** building generator ********************) 24 | mkdir -p $(BIN) 25 | make -C cobra all 26 | 27 | install_deps: 28 | $(info ******************** downloading dependencies ********************) 29 | go get -v ./... 30 | 31 | vet: 32 | $(info ******************** vetting ********************) 33 | go vet ./... 34 | 35 | clean: 36 | rm -rf $(BIN) 37 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/exclude.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | // exclude attempts to return the GitIgnore instance for the 11 | // $GIT_DIR/info/exclude from the working copy to which path belongs. 12 | func exclude(path string) (GitIgnore, error) { 13 | // attempt to locate GIT_DIR 14 | _gitdir := os.Getenv("GIT_DIR") 15 | if _gitdir == "" { 16 | _gitdir = filepath.Join(path, ".git") 17 | } 18 | _info, _err := os.Stat(_gitdir) 19 | if _err != nil { 20 | if os.IsNotExist(_err) { 21 | return nil, nil 22 | } else { 23 | return nil, _err 24 | } 25 | } else if !_info.IsDir() { 26 | return nil, nil 27 | } 28 | 29 | // is there an info/exclude file within this directory? 30 | _file := filepath.Join(_gitdir, "info", "exclude") 31 | _, _err = os.Stat(_file) 32 | if _err != nil { 33 | if os.IsNotExist(_err) { 34 | return nil, nil 35 | } else { 36 | return nil, _err 37 | } 38 | } 39 | 40 | // attempt to load the exclude file 41 | return NewFromFile(_file) 42 | } // exclude() 43 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2021 Ben Boyter 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /assets/database/licenses/NLPL.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "NO LIMIT PUBLIC LICENSE\n\nVersion 0, June 2012 Gilles LAMIRAL\n\nLa Billais\n\n35580 Baulon\n\nFrance NO LIMIT PUBLIC LICENSE\n\nTerms and conditions for copying, distribution, modification or anything else.\n\n 0. No limit to do anything with this work and this license.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e NO LIMIT PUBLIC LICENSE\n\nVersion 0, June 2012\u003c\u003cendOptional\u003e\u003e\u003c\u003cbeginOptional\u003e\u003e Gilles LAMIRAL\n\nLa Billais\n\n35580 Baulon\n\nFrance\u003c\u003cendOptional\u003e\u003e\u003c\u003cbeginOptional\u003e\u003e NO LIMIT PUBLIC LICENSE\u003c\u003cendOptional\u003e\u003e\n\nTerms and conditions for copying, distribution, modification or anything else.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"0.\";match\u003d\".{0,20}\"\u003e\u003e No limit to do anything with this work and this license.", 5 | "name": "No Limit Public License", 6 | "licenseId": "NLPL", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/NLPL" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/xmlSharedStrings.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | import ( 4 | "encoding/xml" 5 | ) 6 | 7 | // xlsxSST directly maps the sst element from the namespace 8 | // http://schemas.openxmlformats.org/spreadsheetml/2006/main currently 9 | // I have not checked this for completeness - it does as much as I need. 10 | type xlsxSST struct { 11 | XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main sst"` 12 | Count int `xml:"count,attr"` 13 | UniqueCount int `xml:"uniqueCount,attr"` 14 | SI []xlsxSI `xml:"si"` 15 | } 16 | 17 | // xlsxSI directly maps the si element from the namespace 18 | // http://schemas.openxmlformats.org/spreadsheetml/2006/main - 19 | // currently I have not checked this for completeness - it does as 20 | // much as I need. 21 | type xlsxSI struct { 22 | T string `xml:"t"` 23 | R []xlsxR `xml:"r"` 24 | } 25 | 26 | // xlsxR directly maps the r element from the namespace 27 | // http://schemas.openxmlformats.org/spreadsheetml/2006/main - 28 | // currently I have not checked this for completeness - it does as 29 | // much as I need. 30 | type xlsxR struct { 31 | T string `xml:"t"` 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/BobuSumisu/aho-corasick/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Øyvind Ingvaldsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Denormal Limited 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/texttheater/golang-levenshtein/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Kilian Evang and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/col.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | // Default column width in excel 4 | const ColWidth = 9.5 5 | 6 | type Col struct { 7 | Min int 8 | Max int 9 | Hidden bool 10 | Width float64 11 | Collapsed bool 12 | OutlineLevel uint8 13 | numFmt string 14 | style *Style 15 | } 16 | 17 | func (c *Col) SetType(cellType CellType) { 18 | switch cellType { 19 | case CellTypeString: 20 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_STRING] 21 | case CellTypeBool: 22 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] //TEMP 23 | case CellTypeNumeric: 24 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_INT] 25 | case CellTypeDate: 26 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_DATE] 27 | case CellTypeFormula: 28 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] 29 | case CellTypeError: 30 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] //TEMP 31 | case CellTypeGeneral: 32 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] 33 | } 34 | } 35 | 36 | // GetStyle returns the Style associated with a Col 37 | func (c *Col) GetStyle() *Style { 38 | return c.style 39 | } 40 | 41 | // SetStyle sets the style of a Col 42 | func (c *Col) SetStyle(style *Style) { 43 | c.style = style 44 | } 45 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute to licensechecker (lc) 2 | 3 | #### **Did you find a bug?** 4 | 5 | * **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/boyter/lc/issues). 6 | 7 | * If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/boyter/lc/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. 8 | 9 | #### **Did you write a patch that fixes a bug?** 10 | 11 | * Open a new GitHub pull request with the patch. 12 | 13 | * Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. 14 | 15 | * Before submitting, please specify that you explicitly licence your contribution under MIT License AND UNLICENSE. 16 | 17 | * If you include compatible code from a third party souce with an altunate license please add a SDPX tag to indicate this, see https://github.com/boyter/lc/blob/master/parsers/helpers.go bytesToHuman function as a reference exmaple. 18 | 19 | 20 | #### **Always remember** 21 | 22 | * Do as Bill and Ted and be excellent to each other. 23 | 24 | Thanks! 25 | -------------------------------------------------------------------------------- /assets/database/licenses/ADSL.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "This software code is made available \"AS IS\" without warranties of any kind. You may copy, display, modify and redistribute the software code either by itself or as incorporated into your code; provided that you do not remove any proprietary notices. Your use of this software code is at your own risk and you waive any claim against Amazon Digital Services, Inc. or its affiliates with respect to your use of this software code. (c) 2006 Amazon Digital Services, Inc. or its affiliates.", 4 | "standardLicenseTemplate": "This software code is made available \"AS IS\" without warranties of any kind. You may copy, display, modify and redistribute the software code either by itself or as incorporated into your code; provided that you do not remove any proprietary notices. Your use of this software code is at your own risk and you waive any claim against Amazon Digital Services, Inc. or its affiliates with respect to your use of this software code. (c) 2006 Amazon Digital Services, Inc. or its affiliates.", 5 | "name": "Amazon Digital Services License", 6 | "licenseId": "ADSL", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/AmazonDigitalServicesLicense" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/Glulxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "The source code in this package is copyright 1999-2010 by Andrew Plotkin.\n\nYou may copy and distribute it freely, by any means and under any conditions, as long as the code and documentation is not changed. You may also incorporate this code into your own program and distribute that, or modify this code and use and distribute the modified version, as long as you retain a notice in your program or documentation which mentions my name and the URL shown above.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"The source code in this package is copyright 1999-2010 by Andrew Plotkin.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nYou may copy and distribute it freely, by any means and under any conditions, as long as the code and documentation is not changed. You may also incorporate this code into your own program and distribute that, or modify this code and use and distribute the modified version, as long as you retain a notice in your program or documentation which mentions my name and the URL shown above.", 5 | "name": "Glulxe License", 6 | "licenseId": "Glulxe", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Glulxe" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /processor/structs.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package processor 4 | 5 | import ahocorasick "github.com/BobuSumisu/aho-corasick" 6 | 7 | // Represents a license inside the JSON which allows us to hopefully match against 8 | type License struct { 9 | LicenseText string `json:"licenseText"` 10 | StandardLicenseTemplate string `json:"standardLicenseTemplate"` 11 | Name string `json:"name"` 12 | LicenseId string `json:"licenseId"` 13 | Keywords []string `json:"keywords"` 14 | LicenseIdDuplicates []string `json:"duplicates"` 15 | ExtraLicenseText []string `json:"extraLicenseText"` 16 | ScorePercentage float64 `json:"scorePercentage"` // this is used so we don't have a new struct 17 | Trie *ahocorasick.Trie // used for faster matching 18 | Concordance Concordance // used for vector matching 19 | MatchType string // indicates how this license match was made 20 | } 21 | 22 | // IdentifiedLicense 23 | type IdentifiedLicense struct { 24 | LicenseId string `json:"licenseId"` 25 | ScorePercentage float64 `json:"scorePercentage"` // this is used so we don't have a new struct 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to -------------------------------------------------------------------------------- /assets/database/licenses/Crossword.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (C) 1995-2009 Gerd Neugebauer\n\ncwpuzzle.dtx is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing.\n\n.\n\nEveryone is granted permission to copy, modify and redistribute cwpuzzle.dtx, provided this copyright notice is preserved and any modifications are indicated.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e Copyright (C) 1995-2009 Gerd Neugebauer\u003c\u003cendOptional\u003e\u003e\n\ncwpuzzle.dtx is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing.\n\n.\n\nEveryone is granted permission to copy, modify and redistribute cwpuzzle.dtx, provided this copyright notice is preserved and any modifications are indicated.", 5 | "name": "Crossword License", 6 | "licenseId": "Crossword", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Crossword" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/SSH-short.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "As far as I am concerned, the code I have written for this software can be used freely for any purpose. Any derived versions of this software must be clearly marked as such, and if the derived work is incompatible with the protocol description in the RFC file, it must be called by a name other than \"ssh\" or \"Secure Shell\".", 4 | "standardLicenseTemplate": "As far as I am concerned, the code I have written for this software can be used freely for any purpose. Any derived versions of this software must be clearly marked as such, and if the derived work is incompatible with the protocol description in the RFC file, it must be called by a name other than \"ssh\" or \"Secure Shell\".", 5 | "name": "SSH short notice", 6 | "licenseComments": "This is short version of SSH-OpenSSH that appears in some files associated with the original SSH implementation.", 7 | "licenseId": "SSH-short", 8 | "seeAlso": [ 9 | "https://github.com/openssh/openssh-portable/blob/1b11ea7c58cd5c59838b5fa574cd456d6047b2d4/pathnames.h", 10 | "http://web.mit.edu/kolya/.f/root/athena.mit.edu/sipb.mit.edu/project/openssh/OldFiles/src/openssh-2.9.9p2/ssh-add.1", 11 | "https://joinup.ec.europa.eu/svn/lesoll/trunk/italc/lib/src/dsa_key.cpp" 12 | ], 13 | "isOsiApproved": false 14 | } -------------------------------------------------------------------------------- /vendor/github.com/BobuSumisu/aho-corasick/match.go: -------------------------------------------------------------------------------- 1 | package ahocorasick 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | // Match represents a matched pattern in the input. 9 | type Match struct { 10 | pos int64 11 | pattern int64 12 | match []byte 13 | } 14 | 15 | func newMatch(pos, pattern int64, match []byte) *Match { 16 | return &Match{pos, pattern, match} 17 | } 18 | 19 | func newMatchString(pos, pattern int64, match string) *Match { 20 | return &Match{pos: pos, pattern: pattern, match: []byte(match)} 21 | } 22 | 23 | func (m *Match) String() string { 24 | return fmt.Sprintf("{%d %d %q}", m.pos, m.pattern, m.match) 25 | } 26 | 27 | // Pos returns the byte position of the match. 28 | func (m *Match) Pos() int64 { 29 | return m.pos 30 | } 31 | 32 | // Pattern returns the pattern id of the match. 33 | func (m *Match) Pattern() int64 { 34 | return m.pattern 35 | } 36 | 37 | // Match returns the pattern matched. 38 | func (m *Match) Match() []byte { 39 | return m.match 40 | } 41 | 42 | // MatchString returns the pattern matched as a string. 43 | func (m *Match) MatchString() string { 44 | return string(m.match) 45 | } 46 | 47 | // MatchEqual check whether two matches are equal (i.e. at same position, pattern and same pattern). 48 | func MatchEqual(a, b *Match) bool { 49 | return a.pos == b.pos && a.pattern == b.pattern && bytes.Equal(a.match, b.match) 50 | } 51 | -------------------------------------------------------------------------------- /assets/database/licenses/WTFPL.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "isFsfLibre": true, 4 | "licenseText": "DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n\nVersion 2, December 2004\n\nCopyright (C) 2004 Sam Hocevar \u003csam@hocevar.net\u003e\n\nEveryone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.\n\nDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n\nTERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n 0. You just DO WHAT THE FUCK YOU WANT TO.", 5 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n\nVersion 2, December 2004\u003c\u003cendOptional\u003e\u003e\n\nCopyright (C) 2004 Sam Hocevar \u003csam@hocevar.net\u003e\n\nEveryone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.\n\nDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n\nTERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"0.\";match\u003d\".{0,20}\"\u003e\u003e You just DO WHAT THE FUCK YOU WANT TO.", 6 | "name": "Do What The F*ck You Want To Public License", 7 | "licenseId": "WTFPL", 8 | "seeAlso": [ 9 | "http://sam.zoy.org/wtfpl/COPYING" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/github.com/danwakefield/fnmatch/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Daniel Wakefield 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /assets/database/licenses/psfrag.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "psfrag.dtx Copyright (C) 1996 Craig Barratt, Michael C. Grant, and David Carlisle.\n\nAll rights are reserved.\n\nThis system is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Don\u0027t come complaining to us if you modify this file and it doesn\u0027t work! If this file is modified by anyone but the authors, those changes and their authors must be explicitly stated HERE.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e psfrag.dtx\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 1996 Craig Barratt, Michael C. Grant, and David Carlisle.\n\nAll rights are reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis system is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Don\u0027t come complaining to us if you modify this file and it doesn\u0027t work! If this file is modified by anyone but the authors, those changes and their authors must be explicitly stated HERE.", 5 | "name": "psfrag License", 6 | "licenseId": "psfrag", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/psfrag" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build go1.4 3 | 4 | package mousetrap 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) { 13 | snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0) 14 | if err != nil { 15 | return nil, err 16 | } 17 | defer syscall.CloseHandle(snapshot) 18 | var procEntry syscall.ProcessEntry32 19 | procEntry.Size = uint32(unsafe.Sizeof(procEntry)) 20 | if err = syscall.Process32First(snapshot, &procEntry); err != nil { 21 | return nil, err 22 | } 23 | for { 24 | if procEntry.ProcessID == uint32(pid) { 25 | return &procEntry, nil 26 | } 27 | err = syscall.Process32Next(snapshot, &procEntry) 28 | if err != nil { 29 | return nil, err 30 | } 31 | } 32 | } 33 | 34 | // StartedByExplorer returns true if the program was invoked by the user double-clicking 35 | // on the executable from explorer.exe 36 | // 37 | // It is conservative and returns false if any of the internal calls fail. 38 | // It does not guarantee that the program was run from a terminal. It only can tell you 39 | // whether it was launched from explorer.exe 40 | func StartedByExplorer() bool { 41 | pe, err := getProcessEntry(os.Getppid()) 42 | if err != nil { 43 | return false 44 | } 45 | return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:]) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/theme.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | ) 7 | 8 | type theme struct { 9 | colors []string 10 | } 11 | 12 | func newTheme(themeXml xlsxTheme) *theme { 13 | clrMap := map[string]string{} 14 | clrSchemes := themeXml.ThemeElements.ClrScheme.Children 15 | for _, scheme := range clrSchemes { 16 | var rgbColor string 17 | if scheme.SysClr != nil { 18 | rgbColor = scheme.SysClr.LastClr 19 | } else { 20 | rgbColor = scheme.SrgbClr.Val 21 | } 22 | clrMap[scheme.XMLName.Local] = rgbColor 23 | } 24 | colors := []string{clrMap["lt1"], clrMap["dk1"], clrMap["lt2"], clrMap["dk2"], clrMap["accent1"], 25 | clrMap["accent2"], clrMap["accent3"], clrMap["accent4"], clrMap["accent5"], 26 | clrMap["accent6"], clrMap["hlink"], clrMap["folHlink"]} 27 | return &theme{colors} 28 | } 29 | 30 | func (t *theme) themeColor(index int64, tint float64) string { 31 | baseColor := t.colors[index] 32 | if tint == 0 { 33 | return "FF" + baseColor 34 | } else { 35 | r, _ := strconv.ParseInt(baseColor[0:2], 16, 64) 36 | g, _ := strconv.ParseInt(baseColor[2:4], 16, 64) 37 | b, _ := strconv.ParseInt(baseColor[4:6], 16, 64) 38 | h, s, l := RGBToHSL(uint8(r), uint8(g), uint8(b)) 39 | if tint < 0 { 40 | l *= (1 + tint) 41 | } else { 42 | l = l*(1-tint) + (1 - (1 - tint)) 43 | } 44 | br, bg, bb := HSLToRGB(h, s, l) 45 | return fmt.Sprintf("FF%02X%02X%02X", br, bg, bb) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /assets/database/licenses/Barr.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "This is a package of commutative diagram macros built on top of Xy-pic by Michael Barr (email: barr@barrs.org). Its use is unrestricted. It may be freely distributed, unchanged, for non-commercial or commercial use. If changed, it must be renamed. Inclusion in a commercial software package is also permitted, but I would appreciate receiving a free copy for my personal examination and use. There are no guarantees that this package is good for anything. I have tested it with LaTeX 2e, LaTeX 2.09 and Plain TeX. Although I know of no reason it will not work with AMSTeX, I have not tested it.", 4 | "standardLicenseTemplate": "This is a package of commutative diagram macros built on top of Xy-pic by Michael Barr (email: barr@barrs.org). Its use is unrestricted. It may be freely distributed, unchanged, for non-commercial or commercial use. If changed, it must be renamed. Inclusion in a commercial software package is also permitted, but I would appreciate receiving a free copy for my personal examination and use. There are no guarantees that this package is good for anything. I have tested it with LaTeX 2e, LaTeX 2.09 and Plain TeX. Although I know of no reason it will not work with AMSTeX, I have not tested it.", 5 | "name": "Barr License", 6 | "licenseId": "Barr", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Barr" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /scripts/include.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package main 4 | 5 | import ( 6 | "encoding/base64" 7 | "fmt" 8 | "os" 9 | "strings" 10 | ) 11 | 12 | func readFile(filepath string) []byte { 13 | // TODO only read as deep into the file as we need 14 | bytes, err := os.ReadFile(filepath) 15 | 16 | if err != nil { 17 | fmt.Print(err) 18 | } 19 | 20 | return bytes 21 | } 22 | 23 | // Reads all .json files in the current folder 24 | // and encodes them as strings literals in constants.go 25 | func main() { 26 | fmt.Println("running...") 27 | files, err := os.ReadDir(".") 28 | if err != nil { 29 | fmt.Println(err.Error()) 30 | } 31 | out, err := os.Create("./processor/constants.go") 32 | if err != nil { 33 | fmt.Println(err.Error()) 34 | } 35 | 36 | // Open constants 37 | out.Write([]byte("package processor \n\nconst (\n")) 38 | 39 | for _, f := range files { 40 | if strings.HasSuffix(f.Name(), ".json") { 41 | // The constant variable name 42 | out.Write([]byte(strings.TrimSuffix(f.Name(), ".json") + " = `")) 43 | 44 | contents := readFile(f.Name()) 45 | str := base64.StdEncoding.EncodeToString(contents) 46 | 47 | out.Write([]byte(str)) 48 | out.Write([]byte("`\n")) 49 | } 50 | } 51 | 52 | // Close out constants 53 | _, err = out.Write([]byte(")\n")) 54 | if err != nil { 55 | fmt.Println(err.Error()) 56 | } 57 | err = out.Close() 58 | if err != nil { 59 | fmt.Println(err.Error()) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /assets/database/licenses/Wsuipa.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "This file was added by Clea F. Rees on 2008/11/30 with the permission of Dean Guenther and pointers to this file were added to all source files.\n\nUnlimited copying and redistribution of each of the files is permitted as long as the file is not modified. Modifications, and redistribution of modified versions, are also permitted, but only if the resulting file is renamed. The copyright holder is Washington State University. The original author of the fonts is Janene Winter. The primary contact (as of 2008) is Dean Guenther.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e This file was added by Clea F. Rees on 2008/11/30 with the permission of Dean Guenther and pointers to this file were added to all source files.\u003c\u003cendOptional\u003e\u003e\n\nUnlimited copying and redistribution of each of the files is permitted as long as the file is not modified. Modifications, and redistribution of modified versions, are also permitted, but only if the resulting file is renamed. \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"The copyright holder is Washington State University. The original author of the fonts is Janene Winter. The primary contact (as of 2008) is Dean Guenther.\";match\u003d\".{0,1000}\"\u003e\u003e", 5 | "name": "Wsuipa License", 6 | "licenseId": "Wsuipa", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Wsuipa" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/token.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | // Token represents a parsed token from a .gitignore stream, encapsulating the 10 | // token type, the runes comprising the token, and the position within the 11 | // stream of the first rune of the token. 12 | type Token struct { 13 | Type TokenType 14 | Word []rune 15 | Position 16 | } 17 | 18 | // NewToken returns a Token instance of the given t, represented by the 19 | // word runes, at the stream position pos. If the token type is not know, the 20 | // returned instance will have type BAD. 21 | func NewToken(t TokenType, word []rune, pos Position) *Token { 22 | // ensure the type is valid 23 | if t < ILLEGAL || t > BAD { 24 | t = BAD 25 | } 26 | 27 | // return the token 28 | return &Token{Type: t, Word: word, Position: pos} 29 | } // NewToken() 30 | 31 | // Name returns a string representation of the Token type. 32 | func (t *Token) Name() string { 33 | return t.Type.String() 34 | } // Name() 35 | 36 | // Token returns the string representation of the Token word. 37 | func (t *Token) Token() string { 38 | return string(t.Word) 39 | } // Token() 40 | 41 | // String returns a string representation of the Token, encapsulating its 42 | // position in the input stream, its name (i.e. type), and its runes. 43 | func (t *Token) String() string { 44 | return fmt.Sprintf("%s: %s %q", t.Position.String(), t.Name(), t.Token()) 45 | } // String() 46 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/check.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT OR Unlicense 4 | 5 | set -e 6 | 7 | if [ -t 1 ] 8 | then 9 | YELLOW='\033[0;33m' 10 | GREEN='\033[0;32m' 11 | RED='\033[0;31m' 12 | NC='\033[0m' 13 | fi 14 | 15 | yellow() { printf "${YELLOW}%s${NC}" "$*"; } 16 | green() { printf "${GREEN}%s${NC}" "$*"; } 17 | red() { printf "${RED}%s${NC}" "$*"; } 18 | 19 | good() { 20 | echo "$(green "● success:")" "$@" 21 | } 22 | 23 | bad() { 24 | ret=$1 25 | shift 26 | echo "$(red "● failed:")" "$@" 27 | exit $ret 28 | } 29 | 30 | try() { 31 | "$@" || bad $? "$@" && good "$@" 32 | } 33 | 34 | 35 | echo "Running go fmt..." 36 | gofmt -s -w ./.. 37 | 38 | echo "Running unit tests..." 39 | go test -cover -race ./... || exit 40 | 41 | { 42 | { 43 | opt='shopt -s extglob nullglob' 44 | gofmt='gofmt -s -w -l !(vendor)/ *.go' 45 | notice=" running: ( $opt; $gofmt; )" 46 | prefix=" $(yellow modified)" 47 | trap 'echo "$notice"; $opt; $gofmt | sed -e "s#^#$prefix #g"' EXIT 48 | } 49 | 50 | # comma separate linters (e.g. "gofmt,stylecheck") 51 | additional_linters="gofmt" 52 | try golangci-lint run --enable $additional_linters ./... 53 | trap '' EXIT 54 | } 55 | 56 | echo "Running fuzz tests..." 57 | go test -fuzz=FuzzTestGitIgnore -fuzztime 30s 58 | 59 | echo -e "${GREEN}=================================================" 60 | echo -e "ALL CHECKS PASSED" 61 | echo -e "=================================================${NC}" 62 | -------------------------------------------------------------------------------- /processor/guesser_full_test.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package processor 4 | 5 | import ( 6 | "encoding/json" 7 | "os" 8 | "testing" 9 | ) 10 | 11 | // Represents what the JSON looks like on disk enough for loading 12 | type LicenseJson struct { 13 | LicenseText string `json:"licenseText"` 14 | StandardLicenseTemplate string `json:"standardLicenseTemplate"` 15 | StandardLicenseHeader string `json:"standardLicenseHeader"` 16 | Name string `json:"name"` 17 | LicenseId string `json:"licenseId"` 18 | } 19 | 20 | func loadLicences() []LicenseJson { 21 | bytes, _ := os.ReadFile("../database_keywords.json") 22 | var licenses []LicenseJson 23 | _ = json.Unmarshal(bytes, &licenses) 24 | return licenses 25 | } 26 | 27 | // Simple test to ensure that the stuff we are about to load actually works as we expect 28 | func TestKeywordCommonDatabase(t *testing.T) { 29 | lg := NewLicenceGuesser(true, false) 30 | lg.UseFullDatabase = true 31 | licenses := loadLicences() 32 | fail := 0 33 | pass := 0 34 | 35 | for _, l := range licenses { 36 | guesses := lg.KeyWordGuessLicence([]byte(l.LicenseText)) 37 | 38 | if len(guesses) == 0 { 39 | fail++ 40 | t.Error("expected", l.LicenseId) 41 | continue 42 | } 43 | 44 | if guesses[0].LicenseId != l.LicenseId { 45 | t.Error("expected", l.LicenseId, "got", guesses[0].LicenseId) 46 | fail++ 47 | } else { 48 | pass++ 49 | } 50 | } 51 | 52 | if fail != 0 { 53 | t.Error(pass, "passes") 54 | t.Error(fail, "fails") 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /assets/database/licenses/GPL-2.0-with-GCC-exception.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": true, 3 | "licenseText": "insert GPL v2 license text here\n\nGCC Linking Exception\n\nIn addition to the permissions in the GNU General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file into combinations with other programs, and to distribute those combinations without any restriction coming from the use of this file. (The General Public License restrictions do apply in other respects; for example, they cover modification of the file, and distribution when not linked into a combine executable.", 4 | "standardLicenseTemplate": "insert GPL v2 license text here\n\nGCC Linking Exception\n\nIn addition to the permissions in the GNU General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file into combinations with other programs, and to distribute those combinations without any restriction coming from the use of this file. (The General Public License restrictions do apply in other respects; for example, they cover modification of the file, and distribution when not linked into a combine executable.", 5 | "name": "GNU General Public License v2.0 w/GCC Runtime Library exception", 6 | "licenseId": "GPL-2.0-with-GCC-exception", 7 | "seeAlso": [ 8 | "https://gcc.gnu.org/git/?p\u003dgcc.git;a\u003dblob;f\u003dgcc/libgcc1.c;h\u003d762f5143fc6eed57b6797c82710f3538aa52b40b;hb\u003dcb143a3ce4fb417c68f5fa2691a1b1b1053dfba9#l10" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/Newsletr.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright 1989--2004 by Hunter Goatley.\n\nPermission is granted to anyone to use this software for any purpose on any computer system, and to redistribute it freely, subject to the following restrictions:\n\n 1. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n 2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright 1989--2004 by Hunter Goatley.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission is granted to anyone to use this software for any purpose on any computer system, and to redistribute it freely, subject to the following restrictions:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.\";match\u003d\".{0,20}\"\u003e\u003e Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.", 5 | "name": "Newsletr License", 6 | "licenseId": "Newsletr", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Newsletr" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /assets/database/licenses/GPL-2.0-with-font-exception.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": true, 3 | "licenseText": "insert GPL v2 license text here\n\nFont Exception\n\nAs a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.", 4 | "standardLicenseTemplate": "insert GPL v2 license text here\n\nFont Exception\n\nAs a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.", 5 | "name": "GNU General Public License v2.0 w/Font exception", 6 | "licenseId": "GPL-2.0-with-font-exception", 7 | "seeAlso": [ 8 | "https://www.gnu.org/licenses/gpl-faq.html#FontException" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/APAFML.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (c) 1985, 1987, 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\n\nThis file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 1985, 1987, 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files.", 5 | "name": "Adobe Postscript AFM License", 6 | "licenseId": "APAFML", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/AdobePostscriptAFM" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/HaskellReport.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Code derived from the document \"Report on the Programming Language\n\nHaskell 2010\", is distributed under the following license:\n\nCopyright (c) 2010 Simon Marlow\n\nThe authors intend this Report to belong to the entire Haskell community, and so we grant permission to copy and distribute it for any purpose, provided that it is reproduced in its entirety, including this Notice. Modified versions of this Report may also be copied and distributed for any purpose, provided that the modified version is clearly presented as such, and that it does not claim to be a definition of the Haskell 2010 Language.", 4 | "standardLicenseTemplate": "Code derived from the document \"Report on the Programming Language\n\nHaskell 2010\", is distributed under the following license:\n\n\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 2010 Simon Marlow\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThe authors intend this Report to belong to the entire Haskell community, and so we grant permission to copy and distribute it for any purpose, provided that it is reproduced in its entirety, including this Notice. Modified versions of this Report may also be copied and distributed for any purpose, provided that the modified version is clearly presented as such, and that it does not claim to be a definition of the Haskell 2010 Language.", 5 | "name": "Haskell Language Report License", 6 | "licenseId": "HaskellReport", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Haskell_Language_Report_License" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Alex Ogier. All rights reserved. 2 | Copyright (c) 2012 The Go Authors. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /assets/database/licenses/XSkat.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "This program is free software; you can redistribute it freely.\n\nUse it at your own risk; there is NO WARRANTY.\n\nRedistribution of modified versions is permitted provided that the following conditions are met:\n\n 1. All copyright \u0026 permission notices are preserved.\n\n 2.a) Only changes required for packaging or porting are made.\n\n or\n\n 2.b) It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix.", 4 | "standardLicenseTemplate": "This program is free software; you can redistribute it freely.\n\nUse it at your own risk; there is NO WARRANTY.\n\nRedistribution of modified versions is permitted provided that the following conditions are met:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e All copyright \u0026 permission notices are preserved.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.a)\";match\u003d\".{0,20}\"\u003e\u003e Only changes required for packaging or porting are made.\n\n or\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.b)\";match\u003d\".{0,20}\"\u003e\u003e It is clearly stated who last changed the program. The program is renamed or the version number is of the form x.y.z, where x.y is the version of the original program and z is an arbitrary suffix.", 5 | "name": "XSkat License", 6 | "licenseId": "XSkat", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/XSkat_License" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /NOTES.md: -------------------------------------------------------------------------------- 1 | Detection Rules 2 | --------------- 3 | 4 | Check the filename 5 | 6 | "li[cs]en[cs]e(s?)", 7 | "legal", 8 | "copy(left|right|ing)", 9 | "unlicense", 10 | "l?gpl([-_ v]?)(\\d\\.?\\d)?", 11 | "bsd", 12 | "mit", 13 | "apache", 14 | 15 | If it falls into one of the above, its highly likely it is a licence, 16 | and should be tested. Note that the name itself highly indicates the 17 | licence itself, with unlicense for example indicating it is the unlicnse. 18 | 19 | Something like licence, legal, or copy(left|right|ing) needs to be checked 20 | because while it is highly likely to have a licence we cannot be sure 21 | as to which licence it actually is. Its also possible that these examples 22 | could have multiple licenses in them. Example github.com/valkey/valkey/COPYING 23 | 24 | "", 25 | ".md", 26 | ".rst", 27 | ".html", 28 | ".txt", 29 | 30 | Where the file matchs the above patterns, where it has has no extention or 31 | one of the others we should inspect it to see if it has a license. Its possible 32 | a licence exists here, but we cannot be sure. Note that its possible there are multiple 33 | licences in the file which needs to be dealt with. 34 | 35 | // SPDX-License-Identifier: MIT OR Unlicense 36 | 37 | For all other files, there are a few possibilities. 38 | The first is that it contains a SPDX header such as the above which indicates 39 | which license the file is under. Its also possible that the header will contain 40 | a full copy of another licence such as MIT, GPL or otherwise. Possibly inside a comment 41 | or a long string declaration in the case of code. Its possible it has multiple. 42 | 43 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/cache.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "sync" 7 | ) 8 | 9 | // Cache is the interface for the GitIgnore cache 10 | type Cache interface { 11 | // Set stores the GitIgnore ignore against its path. 12 | Set(path string, ig GitIgnore) 13 | 14 | // Get attempts to retrieve an GitIgnore instance associated with the given 15 | // path. If the path is not known nil is returned. 16 | Get(path string) GitIgnore 17 | } 18 | 19 | // cache is the default thread-safe cache implementation 20 | type cache struct { 21 | _i map[string]GitIgnore 22 | _lock sync.Mutex 23 | } 24 | 25 | // NewCache returns a Cache instance. This is a thread-safe, in-memory cache 26 | // for GitIgnore instances. 27 | func NewCache() Cache { 28 | return &cache{} 29 | } // Cache() 30 | 31 | // Set stores the GitIgnore ignore against its path. 32 | func (c *cache) Set(path string, ignore GitIgnore) { 33 | if ignore == nil { 34 | return 35 | } 36 | 37 | // ensure the map is defined 38 | if c._i == nil { 39 | c._i = make(map[string]GitIgnore) 40 | } 41 | 42 | // set the cache item 43 | c._lock.Lock() 44 | c._i[path] = ignore 45 | c._lock.Unlock() 46 | } // Set() 47 | 48 | // Get attempts to retrieve an GitIgnore instance associated with the given 49 | // path. If the path is not known nil is returned. 50 | func (c *cache) Get(path string) GitIgnore { 51 | c._lock.Lock() 52 | _ignore, _ok := c._i[path] 53 | c._lock.Unlock() 54 | if _ok { 55 | return _ignore 56 | } else { 57 | return nil 58 | } 59 | } // Get() 60 | 61 | // ensure cache supports the Cache interface 62 | var _ Cache = &cache{} 63 | -------------------------------------------------------------------------------- /assets/database/bsd_extra.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // BSD-3-Clause 4 | var bsd3ClauseExtra = []string{ 5 | `Copyright (c) 2012 Jesse van den Kieboom. All rights reserved. 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following disclaimer 14 | in the documentation and/or other materials provided with the 15 | distribution. 16 | * Neither the name of Google Inc. nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.`, 31 | } 32 | -------------------------------------------------------------------------------- /assets/database/licenses/TCP-wrappers.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright 1995 by Wietse Venema. All rights reserved. Some individual files may be covered by other copyrights.\n\nThis material was originally written and compiled by Wietse Venema at Eindhoven University of Technology, The Netherlands, in 1990, 1991, 1992, 1993, 1994 and 1995.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that this entire copyright notice is duplicated in all such copies.\n\nThis software is provided \"as is\" and without any expressed or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for any particular purpose.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright 1995 by Wietse Venema. All rights reserved. Some individual files may be covered by other copyrights.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis material was originally written and compiled by Wietse Venema at Eindhoven University of Technology, The Netherlands, in 1990, 1991, 1992, 1993, 1994 and 1995.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that this entire copyright notice is duplicated in all such copies.\n\nThis software is provided \"as is\" and without any expressed or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for any particular purpose.", 5 | "name": "TCP Wrappers License", 6 | "licenseId": "TCP-wrappers", 7 | "seeAlso": [ 8 | "http://rc.quest.com/topics/openssh/license.php#tcpwrappers" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/0BSD.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (C) 2006 by Rob Landley \u003crob@landley.net\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 2006 by Rob Landley \u003crob@landley.net\u003e\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", 5 | "name": "BSD Zero Clause License", 6 | "licenseId": "0BSD", 7 | "seeAlso": [ 8 | "http://landley.net/toybox/license.html" 9 | ], 10 | "isOsiApproved": true 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/Borceux.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright 1993 Francis Borceux\n\nYou may freely use, modify, and/or distribute each of the files in this package without limitation. The package consists of the following files:\n\nREADME\n\ncompatibility/OldDiagram\n\ncompatibility/OldMaxiDiagram\n\ncompatibility/OldMicroDiagram\n\ncompatibility/OldMiniDiagram\n\ncompatibility/OldMultipleArrows\n\ndiagram/Diagram\n\ndiagram/MaxiDiagram\n\ndiagram/MicroDiagram\n\ndiagram/MiniDiagram\n\ndiagram/MultipleArrows\n\nuser-guides/Diagram_Mode_d_Emploi\n\nuser-guides/Diagram_Read_Me\n\nOf course no support is guaranteed, but the author will attempt to assist with problems. Current email address:\n\nfrancis dot borceux at uclouvain dot be.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright 1993 Francis Borceux\";match\u003d\".{0,1000}\"\u003e\u003e\n\nYou may freely use, modify, and/or distribute each of the files in this package without limitation. The package consists of the following files:\n\nREADME\n\ncompatibility/OldDiagram\n\ncompatibility/OldMaxiDiagram\n\ncompatibility/OldMicroDiagram\n\ncompatibility/OldMiniDiagram\n\ncompatibility/OldMultipleArrows\n\ndiagram/Diagram\n\ndiagram/MaxiDiagram\n\ndiagram/MicroDiagram\n\ndiagram/MiniDiagram\n\ndiagram/MultipleArrows\n\nuser-guides/Diagram_Mode_d_Emploi\n\nuser-guides/Diagram_Read_Me\n\nOf course no support is guaranteed, but the author will attempt to assist with problems. Current email address:\n\nfrancis dot borceux at uclouvain dot be.", 5 | "name": "Borceux license", 6 | "licenseId": "Borceux", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Borceux" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/Latex2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (C) 2007, 2008, 2009, 2010 Karl Berry.\n\nCopyright (C) 1988, 1994, 2007 Stephen Gilmore.\n\nCopyright (C) 1994, 1995, 1996 Torsten Martinsen.\n\nPermission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.\n\nPermission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.\n\nPermission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 2007, 2008, 2009, 2010 Karl Berry.\n\nCopyright (C) 1988, 1994, 2007 Stephen Gilmore.\n\nCopyright (C) 1994, 1995, 1996 Torsten Martinsen.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.\n\nPermission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.\n\nPermission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.", 5 | "name": "Latex2e License", 6 | "licenseId": "Latex2e", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Latex2e" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /parsers/formatter_test.go: -------------------------------------------------------------------------------- 1 | package parsers 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | ) 7 | 8 | func TestGeneratePackageVerificationCode(t *testing.T) { 9 | result := generatePackageVerificationCode([]FileResult{}) 10 | 11 | if result != "da39a3ee5e6b4b0d3255bfef95601890afd80709" { 12 | t.Errorf("Expect generatePackageVerificationCode to have da39a3ee5e6b4b0d3255bfef95601890afd80709 but got %q", result) 13 | } 14 | } 15 | 16 | func TestGenerateDocumentNamespaceNothingSpecified(t *testing.T) { 17 | DocumentNamespace = "" 18 | result := generateDocumentNamespace() 19 | 20 | if strings.Contains(result, "http://spdx.org/spdxdocs/") == false { 21 | t.Errorf("Expect generateDocumentNamespace to have http://spdx.org/spdxdocs/ but got %q", result) 22 | } 23 | } 24 | 25 | func TestGenerateDocumentNamespaceSomethingSpecified(t *testing.T) { 26 | DocumentNamespace = "something" 27 | result := generateDocumentNamespace() 28 | 29 | if strings.Contains(result, "something") == false { 30 | t.Errorf("Expect generateDocumentNamespace to have something but got %q", result) 31 | } 32 | } 33 | 34 | func TestToTabular(t *testing.T) { 35 | var sample []FileResult 36 | toTabular(sample) 37 | 38 | sample = append(sample, FileResult{}) 39 | toTabular(sample) 40 | } 41 | 42 | func TestToTabularMany(t *testing.T) { 43 | var sample []FileResult 44 | toTabular(sample) 45 | 46 | tmp := "" 47 | for i := 0; i < 80; i++ { 48 | tmp = "a" + tmp 49 | 50 | sample = []FileResult{ 51 | { 52 | Filename: tmp, 53 | LicenseIdentified: []LicenseMatch{ 54 | {LicenseId: tmp}, 55 | }, 56 | }, 57 | } 58 | toTabular(sample) 59 | } 60 | } 61 | 62 | func TestToCSV(t *testing.T) { 63 | var sample []FileResult 64 | toCSV(sample) 65 | 66 | sample = append(sample, FileResult{}) 67 | toCSV(sample) 68 | } 69 | -------------------------------------------------------------------------------- /assets/database/licenses/Abstyles.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "This is APREAMBL.TEX, version 1.10e, written by Hans-Hermann Bode\n\n(HHBODE@DOSUNI1.BITNET), for the BibTeX `adaptable\u0027 family, version 1.10.\n\nSee the file APREAMBL.DOC for a detailed documentation.\n\nThis program is distributed WITHOUT ANY WARRANTY, express or implied.\n\nCopyright (C) 1991, 1992 Hans-Hermann Bode\n\nPermission is granted to make and distribute verbatim copies of this document provided that the copyright notice and this permission notice are preserved on all copies.\n\nPermission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e This is APREAMBL.TEX, version 1.10e, written by Hans-Hermann Bode\n\n(HHBODE@DOSUNI1.BITNET), for the BibTeX `adaptable\u0027 family, version 1.10.\n\nSee the file APREAMBL.DOC for a detailed documentation.\u003c\u003cendOptional\u003e\u003e\n\nThis program is distributed WITHOUT ANY WARRANTY, express or implied.\n\nCopyright (C) 1991, 1992 Hans-Hermann Bode\n\nPermission is granted to make and distribute verbatim copies of this document provided that the copyright notice and this permission notice are preserved on all copies.\n\nPermission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.", 5 | "name": "Abstyles License", 6 | "licenseId": "Abstyles", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Abstyles" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/GPL-2.0-with-bison-exception.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": true, 3 | "licenseText": "Bison Exception\n\nAs a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn\u0027t itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception.\n\nThis special exception was added by the Free Software Foundation in version 2.2 of Bison.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e Bison Exception\u003c\u003cendOptional\u003e\u003e\n\nAs a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn\u0027t itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception.\n\nThis special exception was added by the Free Software Foundation in version 2.2 of Bison.", 5 | "name": "GNU General Public License v2.0 w/Bison exception", 6 | "licenseId": "GPL-2.0-with-bison-exception", 7 | "seeAlso": [ 8 | "http://git.savannah.gnu.org/cgit/bison.git/tree/data/yacc.c?id\u003d193d7c7054ba7197b0789e14965b739162319b5e#n141" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package main 4 | 5 | import ( 6 | "github.com/boyter/lc/processor" 7 | "github.com/spf13/cobra" 8 | "os" 9 | ) 10 | 11 | //go:generate go run scripts/include.go 12 | func main() { 13 | //f, _ := os.Create("profile.pprof") 14 | //pprof.StartCPUProfile(f) 15 | //defer pprof.StopCPUProfile() 16 | 17 | rootCmd := &cobra.Command{ 18 | Use: "lc [flags] [files or directories]", 19 | Long: "Check directory/file for licenses and list what license(s) a file is under.\n" + 20 | "Version " + processor.Version + "\n" + 21 | "Ben Boyter ", 22 | Version: processor.Version, 23 | Run: func(cmd *cobra.Command, args []string) { 24 | // process here 25 | process := processor.NewProcess(".") 26 | process.StartProcess() 27 | }, 28 | } 29 | 30 | flags := rootCmd.PersistentFlags() 31 | 32 | flags.BoolVar( 33 | &processor.IncludeBinaryFiles, 34 | "binary", 35 | false, 36 | "set to disable binary file detection", 37 | ) 38 | flags.BoolVar( 39 | &processor.IgnoreIgnoreFile, 40 | "no-ignore", 41 | false, 42 | "disables .ignore file logic", 43 | ) 44 | flags.BoolVar( 45 | &processor.IgnoreGitIgnore, 46 | "no-gitignore", 47 | false, 48 | "disables .gitignore file logic", 49 | ) 50 | flags.BoolVar( 51 | &processor.IncludeHidden, 52 | "hidden", 53 | false, 54 | "include hidden files", 55 | ) 56 | flags.StringSliceVarP( 57 | &processor.AllowListExtensions, 58 | "include-ext", 59 | "i", 60 | []string{}, 61 | "limit to file extensions case sensitive [comma separated list: e.g. go,java,js,C,cpp]", 62 | ) 63 | flags.StringVarP( 64 | &processor.Format, 65 | "format", 66 | "f", 67 | "tabular", 68 | "set output format [progress, tabular, json, spdx, xlsx, csv]", 69 | ) 70 | 71 | if err := rootCmd.Execute(); err != nil { 72 | os.Exit(1) 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /assets/database/licenses/Spencer-86.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (c) 1986 by University of Toronto. Written by Henry Spencer. Not derived from licensed software.\n\nPermission is granted to anyone to use this software for any purpose on any computer system, and to redistribute it freely, subject to the following restrictions:\n\n 1. The author is not responsible for the consequences of use of this software, no matter how awful, even if they arise from defects in it.\n\n 2. The origin of this software must not be misrepresented, either by explicit claim or by omission.\n\n 3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 1986 by University of Toronto. Written by Henry Spencer. Not derived from licensed software.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission is granted to anyone to use this software for any purpose on any computer system, and to redistribute it freely, subject to the following restrictions:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e The author is not responsible for the consequences of use of this software, no matter how awful, even if they arise from defects in it.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.\";match\u003d\".{0,20}\"\u003e\u003e The origin of this software must not be misrepresented, either by explicit claim or by omission.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"3.\";match\u003d\".{0,20}\"\u003e\u003e Altered versions must be plainly marked as such, and must not be misrepresented as being the original software.", 5 | "name": "Spencer License 86", 6 | "licenseId": "Spencer-86", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Henry_Spencer_Reg-Ex_Library_License" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/TU-Berlin-1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,\n\nTechnische Universitaet Berlin\n\nAny use of this software is permitted provided that this notice is not removed and that neither the authors nor the Technische Universitaet Berlin are deemed to have made any representations as to the suitability of this software for any purpose nor are held responsible for any defects of this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.\n\nAs a matter of courtesy, the authors request to be informed about uses this software has found, about bugs in this software, and about any improvements that may be of general interest. Berlin, 28.11.1994\n\nJutta Degener\n\nCarsten Bormann", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,\n\nTechnische Universitaet Berlin\";match\u003d\".{0,1000}\"\u003e\u003e\n\nAny use of this software is permitted provided that this notice is not removed and that neither the authors nor the Technische Universitaet Berlin are deemed to have made any representations as to the suitability of this software for any purpose nor are held responsible for any defects of this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.\n\nAs a matter of courtesy, the authors request to be informed about uses this software has found, about bugs in this software, and about any improvements that may be of general interest.\u003c\u003cbeginOptional\u003e\u003e Berlin, \u003c\u003cvar;name\u003d\"footerDate\";original\u003d\"28.11.1994\";match\u003d\".+\"\u003e\u003e\n\nJutta Degener\n\nCarsten Bormann\u003c\u003cendOptional\u003e\u003e", 5 | "name": "Technische Universitaet Berlin License 1.0", 6 | "licenseId": "TU-Berlin-1.0", 7 | "seeAlso": [ 8 | "https://github.com/swh/ladspa/blob/7bf6f3799fdba70fda297c2d8fd9f526803d9680/gsm/COPYRIGHT" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/NTP.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "NTP License (NTP) Copyright (c) (CopyrightHoldersName) (From 4-digit-year)-(To 4-digit-year)\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose with or without fee is hereby granted, provided that the above copyright notice appears in all copies and that both the copyright notice and this permission notice appear in supporting documentation, and that the name (TrademarkedName) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. (TrademarkedName) makes no representations about the suitability this software for any purpose. It is provided \"as is\" without express or implied warranty.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e NTP License (NTP)\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) (CopyrightHoldersName) (From 4-digit-year)-(To 4-digit-year)\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose with or without fee is hereby granted, provided that the above copyright notice appears in all copies and that both the copyright notice and this permission notice appear in supporting documentation, and that the name \u003c\u003cvar;name\u003d\"TMname\";original\u003d\"(TrademarkedName)\";match\u003d\".+\"\u003e\u003e not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. \u003c\u003cvar;name\u003d\"TMname\";original\u003d\"(TrademarkedName)\";match\u003d\".+\"\u003e\u003e makes no representations about the suitability this software for any purpose. It is provided \"as is\" without express or implied warranty.", 5 | "name": "NTP License", 6 | "licenseId": "NTP", 7 | "seeAlso": [ 8 | "https://opensource.org/licenses/NTP" 9 | ], 10 | "isOsiApproved": true 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/NTP-0.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "NTP No Attribution (NTP-0) Copyright (4-digit-year) by (CopyrightHoldersName)\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose is hereby granted, provided that the namesof (TrademarkedName) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. (TrademarkedName) makesno representations about the suitability of this software for any purpose. It is provided \"as is\" without express or implied warranty.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e NTP No Attribution (NTP-0)\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (4-digit-year) by (CopyrightHoldersName)\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose is hereby granted, provided that the name\u003c\u003cbeginOptional\u003e\u003es\u003c\u003cendOptional\u003e\u003eof \u003c\u003cvar;name\u003d\"TMname\";original\u003d\"(TrademarkedName)\";match\u003d\".+\"\u003e\u003e not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. \u003c\u003cvar;name\u003d\"TMname\";original\u003d\"(TrademarkedName)\";match\u003d\".+\"\u003e\u003e make\u003c\u003cbeginOptional\u003e\u003es\u003c\u003cendOptional\u003e\u003eno representations about the suitability of this software for any purpose. It is provided \"as is\" without express or implied warranty.", 5 | "name": "NTP No Attribution", 6 | "licenseComments": "This license is similar to NTP, but it omits the language regarding reproduction of copyright and permission notices. It also omits the phrase \"with or without fee\".", 7 | "licenseId": "NTP-0", 8 | "seeAlso": [ 9 | "https://github.com/tytso/e2fsprogs/blob/master/lib/et/et_name.c" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /processor/guesser_blended.go: -------------------------------------------------------------------------------- 1 | package processor 2 | 3 | // GuessLicense tries to guess the licence for this content based on whatever heuristics are set on the 4 | // guesser itself, note that this is a multi stage approach where it mixes each one together 5 | func (l *LicenceGuesser) GuessLicense(content []byte) []License { 6 | // now it gets tricky, the vector space will always return results 7 | // but unless its very confident we should always cross check against keywords 8 | // which allows us to get an averaged rank 9 | 10 | // try keywords first, and if we get anything of high confidence we should assume it was correct 11 | keyWordGuessLicence := l.KeyWordGuessLicence(content) 12 | fkeyWordGuessLicence := l.filterByPercentage(keyWordGuessLicence) 13 | 14 | if len(fkeyWordGuessLicence) != 0 { 15 | // at this point lets get the vector space guesses and see if there is any overlap between the two 16 | // with a high level of confidence 17 | vectorSpaceGuessLicence := l.VectorSpaceGuessLicence(content) 18 | fvectorSpaceGuessLicence := l.filterByPercentage(vectorSpaceGuessLicence) 19 | 20 | // right now lets check both lists to see if anything is common 21 | var common []License 22 | 23 | for _, x := range fkeyWordGuessLicence { 24 | for _, y := range fvectorSpaceGuessLicence { 25 | if x.LicenseId == y.LicenseId { 26 | x.ScorePercentage = (x.ScorePercentage + y.ScorePercentage) / 2 27 | x.MatchType = MatchTypeBlended 28 | common = append(common, x) 29 | } 30 | } 31 | } 32 | 33 | fcommon := l.filterByPercentage(common) 34 | return fcommon 35 | } 36 | 37 | return nil 38 | } 39 | 40 | func (l *LicenceGuesser) filterByPercentage(keyWordGuessLicence []License) []License { 41 | // filter out anything below our cutoff % 42 | var filteredKeywordGuessLicence []License 43 | for _, x := range keyWordGuessLicence { 44 | if x.ScorePercentage >= l.cutoffPercentage { 45 | filteredKeywordGuessLicence = append(filteredKeywordGuessLicence, x) 46 | } 47 | } 48 | 49 | return filteredKeywordGuessLicence 50 | } 51 | -------------------------------------------------------------------------------- /assets/database/licenses/Fair-Source-0.9.json: -------------------------------------------------------------------------------- 1 | { 2 | "licenseText": "Fair Source License, version 0.9 Copyright (C) [year] [copyright owner] Licensor: [legal name of licensor] Software: [name software and version if applicable] Use Limitation: [number] users License Grant. Licensor hereby grants to each recipient of the Software (\"you\") a non-exclusive, non-transferable, royalty-free and fully-paid-up license, under all of the Licensors copyright and patent rights, to use, copy, distribute, prepare derivative works of, publicly perform and display the Software, subject to the Use Limitation and the conditions set forth below. Use Limitation. The license granted above allows use by up to the number of users per entity set forth above (the \"Use Limitation\"). For determining the number of users, \"you\" includes all affiliates, meaning legal entities controlling, controlled by, or under common control with you. If you exceed the Use Limitation, your use is subject to payment of Licensors then-current list price for licenses. Conditions. Redistribution in source code or other forms must include a copy of this license document to be provided in a reasonable manner. Any redistribution of the Software is only allowed subject to this license. Trademarks. This license does not grant you any right in the trademarks, service marks, brand names or logos of Licensor. DISCLAIMER. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OR CONDITION, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. LICENSORS HEREBY DISCLAIM ALL LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE. Termination. If you violate the terms of this license, your rights will terminate automatically and will not be reinstated without the prior written consent of Licensor. Any such termination will not affect the right of others who may have received copies of the Software from you.", 3 | "name": "Fair Source License v0.9", 4 | "licenseId": "Fair-Source-0.9", 5 | "isOsiApproved": false 6 | } -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/xmlTheme.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | import "encoding/xml" 4 | 5 | // xlsxTheme directly maps the theme element in the namespace 6 | // http://schemas.openxmlformats.org/drawingml/2006/main - 7 | // currently I have not checked it for completeness - it does as much 8 | // as I need. 9 | type xlsxTheme struct { 10 | ThemeElements xlsxThemeElements `xml:"themeElements"` 11 | } 12 | 13 | // xlsxThemeElements directly maps the themeElements element in the namespace 14 | // http://schemas.openxmlformats.org/drawingml/2006/main - 15 | // currently I have not checked it for completeness - it does as much 16 | // as I need. 17 | type xlsxThemeElements struct { 18 | ClrScheme xlsxClrScheme `xml:"clrScheme"` 19 | } 20 | 21 | // xlsxClrScheme directly maps the clrScheme element in the namespace 22 | // http://schemas.openxmlformats.org/drawingml/2006/main - 23 | // currently I have not checked it for completeness - it does as much 24 | // as I need. 25 | type xlsxClrScheme struct { 26 | Name string `xml:"name,attr"` 27 | Children []xlsxClrSchemeEl `xml:",any"` 28 | } 29 | 30 | // xlsxClrScheme maps to children of the clrScheme element in the namespace 31 | // http://schemas.openxmlformats.org/drawingml/2006/main - 32 | // currently I have not checked it for completeness - it does as much 33 | // as I need. 34 | type xlsxClrSchemeEl struct { 35 | XMLName xml.Name 36 | SysClr *xlsxSysClr `xml:"sysClr"` 37 | SrgbClr *xlsxSrgbClr `xml:"srgbClr"` 38 | } 39 | 40 | // xlsxSysClr directly maps the sysClr element in the namespace 41 | // http://schemas.openxmlformats.org/drawingml/2006/main - 42 | // currently I have not checked it for completeness - it does as much 43 | // as I need. 44 | type xlsxSysClr struct { 45 | Val string `xml:"val,attr"` 46 | LastClr string `xml:"lastClr,attr"` 47 | } 48 | 49 | // xlsxSrgbClr directly maps the srgbClr element in the namespace 50 | // http://schemas.openxmlformats.org/drawingml/2006/main - 51 | // currently I have not checked it for completeness - it does as much 52 | // as I need. 53 | type xlsxSrgbClr struct { 54 | Val string `xml:"val,attr"` 55 | } 56 | -------------------------------------------------------------------------------- /assets/database/licenses/IBM-pibs.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "This source code has been made available to you by IBM on an AS-IS basis. Anyone receiving this source is licensed under IBM copyrights to use it in any way he or she deems fit, including copying it, modifying it, compiling it, and redistributing it either with or without modifications. No license under IBM patents or patent applications is to be implied by the copyright license.\n\nAny user of this software should understand that IBM cannot provide technical support for this software and will not be responsible for any consequences resulting from the use of this software.\n\nAny person who transfers this source code or any derivative work must include the IBM copyright notice, this paragraph, and the preceding two paragraphs in the transferred software.\n\nCOPYRIGHT I B M CORPORATION 2002\n\nLICENSED MATERIAL - PROGRAM PROPERTY OF I B M", 4 | "standardLicenseTemplate": "This source code has been made available to you by IBM on an AS-IS basis. Anyone receiving this source is licensed under IBM copyrights to use it in any way he or she deems fit, including copying it, modifying it, compiling it, and redistributing it either with or without modifications. No license under IBM patents or patent applications is to be implied by the copyright license.\n\nAny user of this software should understand that IBM cannot provide technical support for this software and will not be responsible for any consequences resulting from the use of this software.\n\nAny person who transfers this source code or any derivative work must include the IBM copyright notice, this paragraph, and the preceding two paragraphs in the transferred software.\n\nCOPYRIGHT I B M CORPORATION 2002\n\nLICENSED MATERIAL - PROGRAM PROPERTY OF I B M", 5 | "name": "IBM PowerPC Initialization and Boot Software", 6 | "licenseId": "IBM-pibs", 7 | "seeAlso": [ 8 | "http://git.denx.de/?p\u003du-boot.git;a\u003dblob;f\u003darch/powerpc/cpu/ppc4xx/miiphy.c;h\u003d297155fdafa064b955e53e9832de93bfb0cfb85b;hb\u003d9fab4bf4cc077c21e43941866f3f2c196f28670d" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/MirOS.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "The MirOS Licence Copyright [YEAR] [NAME] [EMAIL]\n\nProvided that these terms and disclaimer and all copyright notices are retained or reproduced in an accompanying document, permission is granted to deal in this work without restriction, including unlimited rights to use, publicly perform, distribute, sell, modify, merge, give away, or sublicence.\n\nThis work is provided \"AS IS\" and WITHOUT WARRANTY of any kind, to the utmost extent permitted by applicable law, neither express nor implied; without malicious intent or gross negligence. In no event may a licensor, author or contributor be held liable for indirect, direct, other damage, loss, or other issues arising in any way out of dealing in the work, even if advised of the possibility of such damage or existence of a defect, except proven that it results out of said person\u0027s immediate fault when using the work as intended.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e The MirOS Licence\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright [YEAR] [NAME] [EMAIL]\";match\u003d\".{0,1000}\"\u003e\u003e\n\nProvided that these terms and disclaimer and all copyright notices are retained or reproduced in an accompanying document, permission is granted to deal in this work without restriction, including unlimited rights to use, publicly perform, distribute, sell, modify, merge, give away, or sublicence.\n\nThis work is provided \"AS IS\" and WITHOUT WARRANTY of any kind, to the utmost extent permitted by applicable law, neither express nor implied; without malicious intent or gross negligence. In no event may a licensor, author or contributor be held liable for indirect, direct, other damage, loss, or other issues arising in any way out of dealing in the work, even if advised of the possibility of such damage or existence of a defect, except proven that it results out of said person\u0027s immediate fault when using the work as intended.", 5 | "name": "The MirOS Licence", 6 | "licenseId": "MirOS", 7 | "seeAlso": [ 8 | "https://opensource.org/licenses/MirOS" 9 | ], 10 | "isOsiApproved": true 11 | } -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | ACHER 2 | Andrew Schwartz 3 | Artem Chernyak 4 | Artem Chernyak 5 | blackss2 6 | Brandon Mulcahy 7 | Brian Smith 8 | bronze1man 9 | Bruno Bigras 10 | Chris Glass 11 | Colin Fox 12 | Colin Fox 13 | crahles 14 | Daniel Upton 15 | Daniel YC Lin 16 | DerLinkshaender 17 | Eric 18 | frogs 19 | fzerorubigd 20 | Geoffrey J. Teale 21 | Gyu-Ho Lee 22 | Herman Schaaf 23 | Hugh Gao 24 | Iain Lowe 25 | ivnivnch 26 | Jason Hall 27 | Joshua Baker 28 | Kaur Kuut 29 | Lunny Xiao 30 | magician1 31 | Mathias Fredriksson 32 | Matt Aimonetti 33 | Moch. Lutfi 34 | Moch.Lutfi 35 | Neoin 36 | Nguyen Nguyen 37 | Nikita Danilov 38 | OneOfOne 39 | Peter Waller 40 | Philipp Klose 41 | richard bucker 42 | Shawn Milochik 43 | Shawn Smith 44 | Shawn Smith 45 | SHIMADA Koji 46 | Steven Degutis 47 | takuya sato 48 | Thieu Pham 49 | Tormod Erevik Lea 50 | trinchan 51 | U-NORTH_AMERICA\ACHER 52 | YAMADA Tsuyoshi 53 | Yoshiki Shibukawa 54 | zhcy 55 | -------------------------------------------------------------------------------- /processor/common_test.go: -------------------------------------------------------------------------------- 1 | package processor 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestIsLicenceFile(t *testing.T) { 8 | tests := []struct { 9 | name string 10 | val string 11 | want bool 12 | }{ 13 | { 14 | name: "", 15 | val: "mit.txt", 16 | want: true, 17 | }, 18 | { 19 | name: "", 20 | val: "hppc-LICENSE-ASL.txt", 21 | want: true, 22 | }, 23 | { 24 | name: "", 25 | val: "org.apache.lucene.codecs.Codec", 26 | want: false, 27 | }, 28 | { 29 | name: "", 30 | val: "org.apache.lucene.analysis.TokenFilterFactory", 31 | want: false, 32 | }, 33 | } 34 | 35 | for _, tt := range tests { 36 | t.Run(tt.name, func(t *testing.T) { 37 | if got := IsLicenceFile(tt.val); got != tt.want { 38 | t.Errorf("licenseFileRe = %v, want %v for %v", got, tt.want, tt.val) 39 | } 40 | }) 41 | } 42 | } 43 | 44 | func TestContainsString(t *testing.T) { 45 | type args struct { 46 | ids []string 47 | lst []string 48 | } 49 | tests := []struct { 50 | name string 51 | args args 52 | want bool 53 | }{ 54 | { 55 | name: "empty", 56 | args: args{ 57 | ids: []string{}, 58 | lst: []string{}, 59 | }, 60 | want: false, 61 | }, 62 | { 63 | name: "empty lst", 64 | args: args{ 65 | ids: []string{"a", "b", "c"}, 66 | lst: []string{}, 67 | }, 68 | want: false, 69 | }, 70 | { 71 | name: "contains a", 72 | args: args{ 73 | ids: []string{"a", "b", "c"}, 74 | lst: []string{"a"}, 75 | }, 76 | want: true, 77 | }, 78 | { 79 | name: "contains b", 80 | args: args{ 81 | ids: []string{"a", "b", "c"}, 82 | lst: []string{"b"}, 83 | }, 84 | want: true, 85 | }, 86 | { 87 | name: "contains multiple", 88 | args: args{ 89 | ids: []string{"a", "b", "c"}, 90 | lst: []string{"a", "b", "c"}, 91 | }, 92 | want: true, 93 | }, 94 | } 95 | for _, tt := range tests { 96 | t.Run(tt.name, func(t *testing.T) { 97 | if got := ContainsString(tt.args.ids, tt.args.lst); got != tt.want { 98 | t.Errorf("ContainsString() = %v, want %v", got, tt.want) 99 | } 100 | }) 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/xmlContentTypes.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | import ( 4 | "encoding/xml" 5 | ) 6 | 7 | type xlsxTypes struct { 8 | XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"` 9 | 10 | Overrides []xlsxOverride `xml:"Override"` 11 | Defaults []xlsxDefault `xml:"Default"` 12 | } 13 | 14 | type xlsxOverride struct { 15 | PartName string `xml:",attr"` 16 | ContentType string `xml:",attr"` 17 | } 18 | 19 | type xlsxDefault struct { 20 | Extension string `xml:",attr"` 21 | ContentType string `xml:",attr"` 22 | } 23 | 24 | func MakeDefaultContentTypes() (types xlsxTypes) { 25 | types.Overrides = make([]xlsxOverride, 8) 26 | types.Defaults = make([]xlsxDefault, 2) 27 | 28 | types.Overrides[0].PartName = "/_rels/.rels" 29 | types.Overrides[0].ContentType = "application/vnd.openxmlformats-package.relationships+xml" 30 | types.Overrides[1].PartName = "/docProps/app.xml" 31 | types.Overrides[1].ContentType = "application/vnd.openxmlformats-officedocument.extended-properties+xml" 32 | types.Overrides[2].PartName = "/docProps/core.xml" 33 | types.Overrides[2].ContentType = "application/vnd.openxmlformats-package.core-properties+xml" 34 | types.Overrides[3].PartName = "/xl/_rels/workbook.xml.rels" 35 | types.Overrides[3].ContentType = "application/vnd.openxmlformats-package.relationships+xml" 36 | types.Overrides[4].PartName = "/xl/sharedStrings.xml" 37 | types.Overrides[4].ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" 38 | types.Overrides[5].PartName = "/xl/styles.xml" 39 | types.Overrides[5].ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" 40 | types.Overrides[6].PartName = "/xl/workbook.xml" 41 | types.Overrides[6].ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" 42 | types.Overrides[7].PartName = "/xl/theme/theme1.xml" 43 | types.Overrides[7].ContentType = "application/vnd.openxmlformats-officedocument.theme+xml" 44 | 45 | types.Defaults[0].Extension = "rels" 46 | types.Defaults[0].ContentType = "application/vnd.openxmlformats-package.relationships+xml" 47 | types.Defaults[1].Extension = "xml" 48 | types.Defaults[1].ContentType = "application/xml" 49 | return 50 | } 51 | -------------------------------------------------------------------------------- /assets/database/licenses/Xerox.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (c) 1995, 1996 Xerox Corporation. All Rights Reserved.\n\nUse and copying of this software and preparation of derivative works based upon this software are permitted. Any copy of this software or of any derivative work must include the above copyright notice of Xerox Corporation, this paragraph and the one after it. Any distribution of this software or derivative works must comply with all applicable United States export control laws.\n\nThis software is made available AS IS, and XEROX CORPORATION DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND NOTWITHSTANDING ANY OTHER PROVISION CONTAINED HEREIN, ANY LIABILITY FOR DAMAGES RESULTING FROM THE SOFTWARE OR ITS USE IS EXPRESSLY DISCLAIMED, WHETHER ARISING IN CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, EVEN IF XEROX CORPORATION IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 1995, 1996 Xerox Corporation. All Rights Reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nUse and copying of this software and preparation of derivative works based upon this software are permitted. Any copy of this software or of any derivative work must include the above copyright notice of Xerox Corporation, this paragraph and the one after it. Any distribution of this software or derivative works must comply with all applicable United States export control laws.\n\nThis software is made available AS IS, and XEROX CORPORATION DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND NOTWITHSTANDING ANY OTHER PROVISION CONTAINED HEREIN, ANY LIABILITY FOR DAMAGES RESULTING FROM THE SOFTWARE OR ITS USE IS EXPRESSLY DISCLAIMED, WHETHER ARISING IN CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, EVEN IF XEROX CORPORATION IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.", 5 | "name": "Xerox License", 6 | "licenseId": "Xerox", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Xerox" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/zsh_completions.md: -------------------------------------------------------------------------------- 1 | ## Generating Zsh Completion for your cobra.Command 2 | 3 | Cobra supports native Zsh completion generated from the root `cobra.Command`. 4 | The generated completion script should be put somewhere in your `$fpath` named 5 | `_`. 6 | 7 | ### What's Supported 8 | 9 | * Completion for all non-hidden subcommands using their `.Short` description. 10 | * Completion for all non-hidden flags using the following rules: 11 | * Filename completion works by marking the flag with `cmd.MarkFlagFilename...` 12 | family of commands. 13 | * The requirement for argument to the flag is decided by the `.NoOptDefVal` 14 | flag value - if it's empty then completion will expect an argument. 15 | * Flags of one of the various `*Array` and `*Slice` types supports multiple 16 | specifications (with or without argument depending on the specific type). 17 | * Completion of positional arguments using the following rules: 18 | * Argument position for all options below starts at `1`. If argument position 19 | `0` is requested it will raise an error. 20 | * Use `command.MarkZshCompPositionalArgumentFile` to complete filenames. Glob 21 | patterns (e.g. `"*.log"`) are optional - if not specified it will offer to 22 | complete all file types. 23 | * Use `command.MarkZshCompPositionalArgumentWords` to offer specific words for 24 | completion. At least one word is required. 25 | * It's possible to specify completion for some arguments and leave some 26 | unspecified (e.g. offer words for second argument but nothing for first 27 | argument). This will cause no completion for first argument but words 28 | completion for second argument. 29 | * If no argument completion was specified for 1st argument (but optionally was 30 | specified for 2nd) and the command has `ValidArgs` it will be used as 31 | completion options for 1st argument. 32 | * Argument completions only offered for commands with no subcommands. 33 | 34 | ### What's not yet Supported 35 | 36 | * Custom completion scripts are not supported yet (We should probably create zsh 37 | specific one, doesn't make sense to re-use the bash one as the functions will 38 | be different). 39 | * Whatever other feature you're looking for and doesn't exist :) 40 | -------------------------------------------------------------------------------- /assets/database/licenses/Leptonica.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (C) 2001 Leptonica. All rights reserved.\n\nThis software is distributed in the hope that it will be useful, but with NO WARRANTY OF ANY KIND.\n\nNo author or distributor accepts responsibility to anyone for the consequences of using this software, or for whether it serves any particular purpose or works at all, unless he or she says so in writing. Everyone is granted permission to copy, modify and redistribute this source code, for commercial or non-commercial purposes, with the following restrictions:\n\n (1) the origin of this source code must not be misrepresented;\n\n (2) modified versions must be plainly marked as such; and\n\n (3) this notice may not be removed or altered from any source or modified source distribution.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 2001 Leptonica. All rights reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis software is distributed in the hope that it will be useful, but with NO WARRANTY OF ANY KIND.\n\nNo author or distributor accepts responsibility to anyone for the consequences of using this software, or for whether it serves any particular purpose or works at all, unless he or she says so in writing. Everyone is granted permission to copy, modify and redistribute this source code, for commercial or non-commercial purposes, with the following restrictions:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"(1)\";match\u003d\".{0,20}\"\u003e\u003e the origin of this source code must not be misrepresented;\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"(2)\";match\u003d\".{0,20}\"\u003e\u003e modified versions must be plainly marked as such; and\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"(3)\";match\u003d\".{0,20}\"\u003e\u003e this notice may not be removed or altered from any source or modified source distribution.", 5 | "name": "Leptonica License", 6 | "licenseComments": "This is an older license for Leptonica. Currently, it uses BSD-2-Clause (see http://www.leptonica.com/about-the-license.html)", 7 | "licenseId": "Leptonica", 8 | "seeAlso": [ 9 | "https://fedoraproject.org/wiki/Licensing/Leptonica" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /assets/database/README.md: -------------------------------------------------------------------------------- 1 | The following appear to not have any unique ngrams 2 | 3 | ``` 4 | AGPL-3.0-only Ngrams 46034 Unique Ngrams 0 5 | AGPL-3.0-or-later Ngrams 46078 Unique Ngrams 0 6 | AGPL-3.0 Ngrams 46034 Unique Ngrams 0 7 | 8 | Artistic-1.0 Ngrams 6706 Unique Ngrams 0 9 | 10 | GFDL-1.1-or-later Ngrams 24654 Unique Ngrams 0 11 | GFDL-1.1 Ngrams 24654 Unique Ngrams 0 12 | 13 | GFDL-1.2-or-later Ngrams 27626 Unique Ngrams 0 14 | GFDL-1.2 Ngrams 27626 Unique Ngrams 0 15 | 16 | GFDL-1.3-or-later Ngrams 30978 Unique Ngrams 0 17 | GFDL-1.3 Ngrams 30978 Unique Ngrams 0 18 | 19 | GPL-1.0+ Ngrams 17582 Unique Ngrams 0 20 | GPL-1.0-only Ngrams 17550 Unique Ngrams 0 21 | GPL-1.0 Ngrams 17550 Unique Ngrams 0 22 | 23 | GPL-2.0+ Ngrams 24502 Unique Ngrams 0 24 | GPL-2.0-only Ngrams 24502 Unique Ngrams 0 25 | GPL-2.0-or-later Ngrams 24518 Unique Ngrams 0 26 | GPL-2.0 Ngrams 24502 Unique Ngrams 0 27 | 28 | GPL-3.0+ Ngrams 46974 Unique Ngrams 0 29 | GPL-3.0-only Ngrams 46978 Unique Ngrams 0 30 | GPL-3.0 Ngrams 46974 Unique Ngrams 0 31 | 32 | LGPL-2.0+ Ngrams 34866 Unique Ngrams 0 33 | LGPL-2.0-only Ngrams 34866 Unique Ngrams 0 34 | LGPL-2.0-or-later Ngrams 34882 Unique Ngrams 0 35 | LGPL-2.0 Ngrams 34866 Unique Ngrams 0 36 | 37 | LGPL-2.1+ Ngrams 36578 Unique Ngrams 0 38 | LGPL-2.1-only Ngrams 36578 Unique Ngrams 0 39 | LGPL-2.1 Ngrams 36578 Unique Ngrams 0 40 | 41 | LGPL-3.0+ Ngrams 10502 Unique Ngrams 0 42 | LGPL-3.0-only Ngrams 10502 Unique Ngrams 0 43 | LGPL-3.0-or-later Ngrams 10502 Unique Ngrams 0 44 | LGPL-3.0 Ngrams 10502 Unique Ngrams 0 45 | 46 | MPL-2.0-no-copyleft-exception Ngrams 20926 Unique Ngrams 0 47 | MPL-2.0 Ngrams 20926 Unique Ngrams 0 48 | 49 | SMLNJ Ngrams 1390 Unique Ngrams 0 50 | 51 | StandardML-NJ Ngrams 1390 Unique Ngrams 0 52 | ``` 53 | 54 | For the above we need to determine if it falls into one of the above buckets... which means we need to find 55 | a ngram that's perhaps common to that group 56 | 57 | So if we check the file, and we don't have a match at all, it means it might be one of the above. IE the lack of anything 58 | indicates that it could be one of the above. 59 | 60 | 61 | Alturnate idea, pick one of them to be the defacto version for that. So in the case of GPL-3.0 go with GPL-3.0 because 62 | that seems like a resonable guess. Should resolve it for most of them. 63 | -------------------------------------------------------------------------------- /assets/database/licenses/GPL-2.0-with-classpath-exception.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": true, 3 | "licenseText": "insert GPL v2 license text here\n\nClass Path Exception\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.\n\nAs a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.", 4 | "standardLicenseTemplate": "insert GPL v2 license text here\n\nClass Path Exception\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.\n\nAs a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.", 5 | "name": "GNU General Public License v2.0 w/Classpath exception", 6 | "licenseId": "GPL-2.0-with-classpath-exception", 7 | "seeAlso": [ 8 | "https://www.gnu.org/software/classpath/license.html" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/RSA-MD.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.\n\nLicense to copy and use this software is granted provided that it is identified as the \"RSA Data Security, Inc. MD5 Message-Digest Algorithm\" in all material mentioning or referencing this software or this function.\n\nLicense is also granted to make and use derivative works provided that such works are identified as \"derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm\" in all material mentioning or referencing the derived work.\n\nRSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided \"as is\" without express or implied warranty of any kind.\n\nThese notices must be retained in any copies of any part of this documentation and/or software.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nLicense to copy and use this software is granted provided that it is identified as the \"RSA Data Security, Inc. \u003c\u003cvar;name\u003d\"algorithm\";original\u003d\"MD5\";match\u003d\"(MD5|MD4)\"\u003e\u003e Message-Digest Algorithm\" in all material mentioning or referencing this software or this function.\n\nLicense is also granted to make and use derivative works provided that such works are identified as \"derived from the RSA Data Security, Inc. \u003c\u003cvar;name\u003d\"algorithm\";original\u003d\"MD5\";match\u003d\"(MD5|MD4)\"\u003e\u003e Message-Digest Algorithm\" in all material mentioning or referencing the derived work.\n\nRSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided \"as is\" without express or implied warranty of any kind.\n\nThese notices must be retained in any copies of any part of this documentation and/or software.", 5 | "name": "RSA Message-Digest License ", 6 | "licenseId": "RSA-MD", 7 | "seeAlso": [ 8 | "http://www.faqs.org/rfcs/rfc1321.html" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/CrystalStacker.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Crystal Stacker is freeware. This means you can pass copies around freely provided you include this document in it\u0027s original form in your distribution. Please see the \"Contacting Us\" section of this document if you need to contact us for any reason.\n\nDisclaimer\n\nNewCreature Design makes no guarantees regarding the Crystal Stacker software. We are not responsible for damages caused by it, though the software is not known to cause any problems. If you have trouble with the software, see the \"Contacting Us\" section of this document.\n\nThe source code is provided as-is and you may do with it whatsoever you please provided that you include this file in its unmodified form with any new distribution. NewCreature Design makes no gaurantees regarding the usability of the source but are willing to help with any problems you might run into. Please see the \"Contacting Us\" section of this document if you need to get in touch with us about any issues you have regarding the source.", 4 | "standardLicenseTemplate": "Crystal Stacker is freeware. This means you can pass copies around freely provided you include this document in it\u0027s original form in your distribution. Please see the \"Contacting Us\" section of this document if you need to contact us for any reason.\n\nDisclaimer\n\nNewCreature Design makes no guarantees regarding the Crystal Stacker software. We are not responsible for damages caused by it, though the software is not known to cause any problems. If you have trouble with the software, see the \"Contacting Us\" section of this document.\n\nThe source code is provided as-is and you may do with it whatsoever you please provided that you include this file in its unmodified form with any new distribution. NewCreature Design makes no gaurantees regarding the usability of the source but are willing to help with any problems you might run into. Please see the \"Contacting Us\" section of this document if you need to get in touch with us about any issues you have regarding the source.", 5 | "name": "CrystalStacker License", 6 | "licenseId": "CrystalStacker", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing:CrystalStacker?rd\u003dLicensing/CrystalStacker" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /check.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [ -t 1 ] 6 | then 7 | YELLOW='\033[0;33m' 8 | GREEN='\033[0;32m' 9 | RED='\033[0;31m' 10 | NC='\033[0m' 11 | fi 12 | 13 | yellow() { printf "${YELLOW}%s${NC}" "$*"; } 14 | green() { printf "${GREEN}%s${NC}" "$*"; } 15 | red() { printf "${RED}%s${NC}" "$*"; } 16 | 17 | good() { 18 | echo "$(green "● success:")" "$@" 19 | } 20 | 21 | bad() { 22 | ret=$1 23 | shift 24 | echo "$(red "● failed:")" "$@" 25 | exit $ret 26 | } 27 | 28 | try() { 29 | "$@" || bad $? "$@" && good "$@" 30 | } 31 | 32 | 33 | echo "Running go fmt..." 34 | gofmt -s -w ./.. 35 | 36 | echo "Running unit tests..." 37 | go test -cover -race ./... || exit 38 | 39 | { 40 | { 41 | opt='shopt -s extglob nullglob' 42 | gofmt='gofmt -s -w -l !(vendor)/ *.go' 43 | notice=" running: ( $opt; $gofmt; )" 44 | prefix=" $(yellow modified)" 45 | trap 'echo "$notice"; $opt; $gofmt | sed -e "s#^#$prefix #g"' EXIT 46 | } 47 | 48 | # comma separate linters (e.g. "gofmt,stylecheck") 49 | additional_linters="gofmt" 50 | try golangci-lint run --enable $additional_linters ./... 51 | trap '' EXIT 52 | } 53 | 54 | # Race Detection 55 | echo "Running race detection..." 56 | if go run --race . t NOT something test~1 "ten thousand a year" "/pr[a-z]de/" 2>&1 >/dev/null | grep -q "Found" ; then 57 | echo -e "${RED}=======================================================" 58 | echo -e "FAILED race detection run 'go run --race . test' to identify" 59 | echo -e "=======================================================${NC}" 60 | exit 61 | else 62 | echo -e "${GREEN}PASSED race detection${NC}" 63 | fi 64 | 65 | echo "Building application..." 66 | go build -ldflags="-s -w" || exit 67 | 68 | echo -e "${NC}Checking compile targets..." 69 | 70 | echo " darwin..." 71 | GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" 72 | echo " windows..." 73 | GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" 74 | echo " linux..." 75 | GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" 76 | GOOS=linux GOARCH=386 go build -ldflags="-s -w" 77 | 78 | echo -e "${NC}Cleaning up..." 79 | rm ./cs 80 | rm ./cs.exe 81 | 82 | echo -e "${GREEN}=================================================" 83 | echo -e "ALL CHECKS PASSED" 84 | echo -e "=================================================${NC}" 85 | -------------------------------------------------------------------------------- /assets/database/licenses/Afmparse.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "(C) 1988, 1989 by Adobe Systems Incorporated. All rights reserved.\n\nThis file may be freely copied and redistributed as long as:\n\n 1) This entire notice continues to be included in the file,\n\n 2) If the file has been modified in any way, a notice of such modification is conspicuously indicated.\n\nPostScript, Display PostScript, and Adobe are registered trademarks of Adobe Systems Incorporated.\n\nTHE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"(C) 1988, 1989 by Adobe Systems Incorporated. All rights reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis file may be freely copied and redistributed as long as:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1)\";match\u003d\".{0,20}\"\u003e\u003e This entire notice continues to be included in the file,\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2)\";match\u003d\".{0,20}\"\u003e\u003e If the file has been modified in any way, a notice of such modification is conspicuously indicated.\n\nPostScript, Display PostScript, and Adobe are registered trademarks of Adobe Systems Incorporated.\n\nTHE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED. ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY) WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.", 5 | "name": "Afmparse License", 6 | "licenseId": "Afmparse", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Afmparse" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /processor/guesser.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package processor 4 | 5 | import ( 6 | "encoding/base64" 7 | "encoding/json" 8 | corasick "github.com/BobuSumisu/aho-corasick" 9 | "strings" 10 | ) 11 | 12 | func NewLicenceGuesser(keyword bool, vectorspace bool) LicenceGuesser { 13 | l := LicenceGuesser{} 14 | l.keyword = keyword 15 | l.vectorspace = vectorspace 16 | l.LoadDatabase() 17 | l.UseFullDatabase = false 18 | l.cutoffPercentage = 60 19 | return l 20 | } 21 | 22 | type LicenceGuesser struct { 23 | Database []License 24 | CommonDatabase []License 25 | UseFullDatabase bool 26 | keyword bool 27 | vectorspace bool 28 | cutoffPercentage float64 29 | } 30 | 31 | // LoadDatabase will initialize the database values and should only be called once such as in an init 32 | func (l *LicenceGuesser) LoadDatabase() { 33 | if len(l.Database) != 0 { 34 | return 35 | } 36 | 37 | data, _ := base64.StdEncoding.DecodeString(database_keywords) 38 | _ = json.Unmarshal(data, &l.Database) 39 | 40 | // Load smaller faster database for checking most common licenses 41 | common := []string{ 42 | "MIT", 43 | "Apache-2.0", 44 | "GPL-3.0", 45 | "AGPL-3.0", 46 | "BSD-3-Clause", 47 | "GPL-2.0", 48 | "BSD-2-Clause", 49 | "CC0-1.0", 50 | "LGPL-3.0", 51 | "LGPL-2.1", 52 | "ISC", 53 | "0BSD", 54 | "LGPL-2.0", 55 | "Unlicense", 56 | "BSD-3-Clause-No-Nuclear-License-2014", 57 | "MPL-2.0", 58 | "EPL-1.0", 59 | "MPL-2.0-no-copyleft-exception", 60 | "AGPL-1.0", 61 | "CC-BY-4.0", 62 | "IPL-1.0", 63 | "CPL-1.0", 64 | "CC-BY-3.0", 65 | "CC-BY-SA-4.0", 66 | "WTFPL", 67 | "Zlib", 68 | "CC-BY-SA-3.0", 69 | "Cube", 70 | "JSON", 71 | "BitTorrent-1.0", 72 | } 73 | 74 | if l.keyword { 75 | for i := 0; i < len(l.Database); i++ { 76 | l.Database[i].Trie = corasick.NewTrieBuilder(). 77 | AddStrings(l.Database[i].Keywords). 78 | Build() 79 | } 80 | } 81 | 82 | if l.vectorspace { 83 | for i := 0; i < len(l.Database); i++ { 84 | l.Database[i].Concordance = BuildConcordance(strings.Split(LcCleanText(l.Database[i].LicenseText), " ")) 85 | } 86 | } 87 | 88 | for _, license := range l.Database { 89 | for _, com := range common { 90 | if license.LicenseId == com { 91 | l.CommonDatabase = append(l.CommonDatabase, license) 92 | } 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /assets/database/licenses/GL2PS.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "GL2PS LICENSE Version 2, November 2003 Copyright (C) 2003, Christophe Geuzaine\n\nPermission to use, copy, and distribute this software and its documentation for any purpose with or without fee is hereby granted, provided that the copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation.\n\nPermission to modify and distribute modified versions of this software is granted, provided that:\n\n 1) the modifications are licensed under the same terms as this software;\n\n 2) you make available the source code of any modifications that you distribute, either on the same media as you distribute any executable or other form of this software, or via a mechanism generally accepted in the software development community for the electronic transfer of data.\n\nThis software is provided \"as is\" without express or implied warranty.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e GL2PS LICENSE Version 2, November 2003\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (C) 2003, Christophe Geuzaine\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, and distribute this software and its documentation for any purpose with or without fee is hereby granted, provided that the copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation.\n\nPermission to modify and distribute modified versions of this software is granted, provided that:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1)\";match\u003d\".{0,20}\"\u003e\u003e the modifications are licensed under the same terms as this software;\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2)\";match\u003d\".{0,20}\"\u003e\u003e you make available the source code of any modifications that you distribute, either on the same media as you distribute any executable or other form of this software, or via a mechanism generally accepted in the software development community for the electronic transfer of data.\n\nThis software is provided \"as is\" without express or implied warranty.", 5 | "name": "GL2PS License", 6 | "licenseId": "GL2PS", 7 | "seeAlso": [ 8 | "http://www.geuz.org/gl2ps/COPYING.GL2PS" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/reftable.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | type RefTable struct { 4 | indexedStrings []string 5 | knownStrings map[string]int 6 | isWrite bool 7 | } 8 | 9 | // NewSharedStringRefTable() creates a new, empty RefTable. 10 | func NewSharedStringRefTable() *RefTable { 11 | rt := RefTable{} 12 | rt.knownStrings = make(map[string]int) 13 | return &rt 14 | } 15 | 16 | // MakeSharedStringRefTable() takes an xlsxSST struct and converts 17 | // it's contents to an slice of strings used to refer to string values 18 | // by numeric index - this is the model used within XLSX worksheet (a 19 | // numeric reference is stored to a shared cell value). 20 | func MakeSharedStringRefTable(source *xlsxSST) *RefTable { 21 | reftable := NewSharedStringRefTable() 22 | reftable.isWrite = false 23 | for _, si := range source.SI { 24 | if len(si.R) > 0 { 25 | newString := "" 26 | for j := 0; j < len(si.R); j++ { 27 | newString = newString + si.R[j].T 28 | } 29 | reftable.AddString(newString) 30 | } else { 31 | reftable.AddString(si.T) 32 | } 33 | } 34 | return reftable 35 | } 36 | 37 | // makeXlsxSST() takes a RefTable and returns and 38 | // equivalent xlsxSST representation. 39 | func (rt *RefTable) makeXLSXSST() xlsxSST { 40 | sst := xlsxSST{} 41 | sst.Count = len(rt.indexedStrings) 42 | sst.UniqueCount = sst.Count 43 | for _, ref := range rt.indexedStrings { 44 | si := xlsxSI{} 45 | si.T = ref 46 | sst.SI = append(sst.SI, si) 47 | } 48 | return sst 49 | } 50 | 51 | // Resolvesharedstring() looks up a string value by numeric index from 52 | // a provided reference table (just a slice of strings in the correct 53 | // order). This function only exists to provide clarity or purpose 54 | // via it's name. 55 | func (rt *RefTable) ResolveSharedString(index int) string { 56 | return rt.indexedStrings[index] 57 | } 58 | 59 | // AddString adds a string to the reference table and return it's 60 | // numeric index. If the string already exists then it simply returns 61 | // the existing index. 62 | func (rt *RefTable) AddString(str string) int { 63 | if rt.isWrite { 64 | index, ok := rt.knownStrings[str] 65 | if ok { 66 | return index 67 | } 68 | } 69 | rt.indexedStrings = append(rt.indexedStrings, str) 70 | index := len(rt.indexedStrings) - 1 71 | rt.knownStrings[str] = index 72 | return index 73 | } 74 | 75 | func (rt *RefTable) Length() int { 76 | return len(rt.indexedStrings) 77 | } 78 | -------------------------------------------------------------------------------- /processor/common.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Unlicense 2 | 3 | package processor 4 | 5 | import ( 6 | "fmt" 7 | "regexp" 8 | "strings" 9 | ) 10 | 11 | var alphaNumericRegex = regexp.MustCompile("[^a-zA-Z0-9 ]") 12 | var multipleSpacesRegex = regexp.MustCompile("\\s+") 13 | 14 | // Very specific cleaner which is designed to clean to the format lc uses to match things 15 | // so be very careful if you choose to use this 16 | func LcCleanText(content string) string { 17 | content = strings.ToLower(content) 18 | 19 | content = alphaNumericRegex.ReplaceAllString(content, " ") 20 | content = multipleSpacesRegex.ReplaceAllString(content, " ") 21 | content = strings.TrimSpace(content) 22 | 23 | return content 24 | } 25 | 26 | const ( 27 | MatchTypeSpdx = "SPDX" 28 | MatchTypeKeyword = "Keyword" 29 | MatchTypeVector = "Vector" 30 | MatchTypeBlended = "Blended" 31 | ) 32 | 33 | // Lifted from https://github.com/go-enry/go-license-detector/blob/580c5627556917dee649cdb2b179cb42d6c56a60/licensedb/internal/investigation.go#L29 34 | // SPDX-License-Identifier: Apache-2.0 35 | var ( 36 | // Base names of guessable license files 37 | licenseFileNames = []string{ 38 | "li[cs]en[cs]e(s?)", 39 | "legal", 40 | "copy(left|right|ing)", 41 | "unlicense", 42 | "l?gpl([-_ v]?)(\\d\\.?\\d)?", 43 | "bsd", 44 | "mit", 45 | "apache", 46 | } 47 | 48 | // License file extensions. Combined with the fileNames slice 49 | // to create a set of files we can reasonably assume contain 50 | // licensing information. 51 | fileExtensions = []string{ 52 | "", 53 | ".md", 54 | ".rst", 55 | ".html", 56 | ".txt", 57 | } 58 | 59 | licenseFileRe = regexp.MustCompile( 60 | fmt.Sprintf("^(|.*[-_. ])(%s)(|[-_. ].*)$", 61 | strings.Join(licenseFileNames, "|"))) 62 | 63 | readmeFileRe = regexp.MustCompile(fmt.Sprintf("^(readme|guidelines)(%s)$", 64 | strings.Replace(strings.Join(fileExtensions, "|"), ".", "\\.", -1))) 65 | ) 66 | 67 | func IsLicenceFile(filename string) bool { 68 | // attempt to filter out false positives that come from java due to filenames 69 | if strings.Count(filename, ".") > 2 { 70 | return false 71 | } 72 | 73 | return licenseFileRe.Match([]byte(strings.ToLower(filename))) 74 | } 75 | 76 | func ContainsString(ids []string, lst []string) bool { 77 | for _, j := range ids { 78 | for _, i := range lst { 79 | if i == j { 80 | return true 81 | } 82 | } 83 | } 84 | 85 | return false 86 | } 87 | -------------------------------------------------------------------------------- /Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" 6 | name = "github.com/inconshreveable/mousetrap" 7 | packages = ["."] 8 | pruneopts = "UT" 9 | revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" 10 | version = "v1.0" 11 | 12 | [[projects]] 13 | branch = "master" 14 | digest = "1:e7a1af77ee190b4c4558142e769a6ab5df14e9f5768119f630128cff9060df54" 15 | name = "github.com/monochromegane/go-gitignore" 16 | packages = ["."] 17 | pruneopts = "UT" 18 | revision = "38717d0a108ca0e5af632cd6845ca77d45b50729" 19 | 20 | [[projects]] 21 | digest = "1:f6adcf4df6c030a53a14a8fdbb3fade7cac3d014ff78a4e0de500b4c0cf5154f" 22 | name = "github.com/spf13/cobra" 23 | packages = ["."] 24 | pruneopts = "UT" 25 | revision = "a684a6d7f5e37385d954dd3b5a14fc6912c6ab9d" 26 | version = "v1.0.0" 27 | 28 | [[projects]] 29 | digest = "1:524b71991fc7d9246cc7dc2d9e0886ccb97648091c63e30eef619e6862c955dd" 30 | name = "github.com/spf13/pflag" 31 | packages = ["."] 32 | pruneopts = "UT" 33 | revision = "2e9d26c8c37aae03e3f9d4e90b7116f5accb7cab" 34 | version = "v1.0.5" 35 | 36 | [[projects]] 37 | digest = "1:e60f2f1cd2e8dfdea48c2440c303d103266e754ab1d8b75796a4e4caddb7a68c" 38 | name = "github.com/tealeg/xlsx" 39 | packages = ["."] 40 | pruneopts = "UT" 41 | revision = "8be35264fa75a1bbe954ce51eba04f273e2c59e5" 42 | version = "v1.0.3" 43 | 44 | [[projects]] 45 | branch = "master" 46 | digest = "1:a38c75e7edd595bbaa03334c1ac26163a5e990d81f05cd9ec5fd0edc9c786078" 47 | name = "github.com/texttheater/golang-levenshtein" 48 | packages = ["levenshtein"] 49 | pruneopts = "UT" 50 | revision = "d188e65d659ef53fcdb0691c12f1bba64928b649" 51 | 52 | [[projects]] 53 | digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679" 54 | name = "github.com/urfave/cli" 55 | packages = ["."] 56 | pruneopts = "UT" 57 | revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" 58 | version = "v1.20.0" 59 | 60 | [solve-meta] 61 | analyzer-name = "dep" 62 | analyzer-version = 1 63 | input-imports = [ 64 | "github.com/monochromegane/go-gitignore", 65 | "github.com/spf13/cobra", 66 | "github.com/tealeg/xlsx", 67 | "github.com/texttheater/golang-levenshtein/levenshtein", 68 | "github.com/urfave/cli", 69 | ] 70 | solver-name = "gps-cdcl" 71 | solver-version = 1 72 | -------------------------------------------------------------------------------- /assets/database/licenses/ANTLR-PD.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "ANTLR 2 License\n\nWe reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the incorporation of ANTLR, or its output, into commerical software.\n\nWe encourage users to develop software with ANTLR. However, we do ask that credit is given to us for developing ANTLR. By \"credit\", we mean that if you use ANTLR or incorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output, please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available as they are completed.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e ANTLR 2 License\u003c\u003cendOptional\u003e\u003e\n\nWe reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the incorporation of ANTLR, or its output, into commerical software.\n\nWe encourage users to develop software with ANTLR. However, we do ask that credit is given to us for developing ANTLR. By \"credit\", we mean that if you use ANTLR or incorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output, please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available as they are completed.", 5 | "name": "ANTLR Software Rights Notice", 6 | "licenseComments": "ANTLR used this public domain notice through version 2.7 and then switched to a BSD license for version 3.0 and later.", 7 | "licenseId": "ANTLR-PD", 8 | "seeAlso": [ 9 | "http://www.antlr2.org/license.html" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /assets/database/licenses/MIT-feh.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies of the Software and its documentation and acknowledgment shall be given in the documentation and software packages that this Software was used.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 4 | "standardLicenseTemplate": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies of the Software and its documentation and acknowledgment shall be given in the documentation and software packages that this Software was used.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 5 | "name": "feh License", 6 | "licenseId": "MIT-feh", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/MIT#feh" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/Rdisc.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Rdisc (this program) was developed by Sun Microsystems, Inc. and is provided for unrestricted use provided that this legend is included on all tape media and as a part of the software program in whole or part. Users may copy or modify Rdisc without charge, and they may freely distribute it.\n\nRDISC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.\n\nRdisc is provided with no support and without any obligation on the part of Sun Microsystems, Inc. to assist in its use, correction, modification or enhancement.\n\nSUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY RDISC OR ANY PART THEREOF.\n\nIn no event will Sun Microsystems, Inc. be liable for any lost revenue or profits or other special, indirect and consequential damages, even if Sun has been advised of the possibility of such damages.\n\nSun Microsystems, Inc.\n\n2550 Garcia Avenue\n\nMountain View, California 94043", 4 | "standardLicenseTemplate": "Rdisc (this program) was developed by Sun Microsystems, Inc. and is provided for unrestricted use provided that this legend is included on all tape media and as a part of the software program in whole or part. Users may copy or modify Rdisc without charge, and they may freely distribute it.\n\nRDISC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.\n\nRdisc is provided with no support and without any obligation on the part of Sun Microsystems, Inc. to assist in its use, correction, modification or enhancement.\n\nSUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY RDISC OR ANY PART THEREOF.\n\nIn no event will Sun Microsystems, Inc. be liable for any lost revenue or profits or other special, indirect and consequential damages, even if Sun has been advised of the possibility of such damages.\n\nSun Microsystems, Inc.\n\n2550 Garcia Avenue\n\nMountain View, California 94043", 5 | "name": "Rdisc License", 6 | "licenseId": "Rdisc", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Rdisc_License" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/curl.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "COPYRIGHT AND PERMISSION NOTICE Copyright (c) 1996 - 2015, Daniel Stenberg, \u003cdaniel@haxx.se\u003e.\n\nAll rights reserved.\n\nPermission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e COPYRIGHT AND PERMISSION NOTICE\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 1996 - 2015, Daniel Stenberg, \u003cdaniel@haxx.se\u003e.\n\nAll rights reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.", 5 | "name": "curl License", 6 | "licenseId": "curl", 7 | "seeAlso": [ 8 | "https://github.com/bagder/curl/blob/master/COPYING" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/libselinux-1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "This library (libselinux) is public domain software, i.e. not copyrighted.\n\nWarranty Exclusion ------------------\n\nYou agree that this software is a non-commercially developed program that may contain \"bugs\" (as that term is used in the industry) and that it may not function as intended. The software is licensed \"as is\". NSA makes no, and hereby expressly disclaims all, warranties, express, implied, statutory, or otherwise with respect to the software, including noninfringement and the implied warranties of merchantability and fitness for a particular purpose.\n\nLimitation of Liability -----------------------\n\nIn no event will NSA be liable for any damages, including loss of data, lost profits, cost of cover, or other special, incidental, consequential, direct or indirect damages arising from the software or the use thereof, however caused and on any theory of liability. This limitation will apply even if NSA has been advised of the possibility of such damage. You acknowledge that this is a reasonable allocation of risk.", 4 | "standardLicenseTemplate": "This library (libselinux) is public domain software, i.e. not copyrighted.\n\nWarranty Exclusion\u003c\u003cbeginOptional\u003e\u003e ------------------\u003c\u003cendOptional\u003e\u003e\n\nYou agree that this software is a non-commercially developed program that may contain \"bugs\" (as that term is used in the industry) and that it may not function as intended. The software is licensed \"as is\". NSA makes no, and hereby expressly disclaims all, warranties, express, implied, statutory, or otherwise with respect to the software, including noninfringement and the implied warranties of merchantability and fitness for a particular purpose.\n\nLimitation of Liability\u003c\u003cbeginOptional\u003e\u003e -----------------------\u003c\u003cendOptional\u003e\u003e\n\nIn no event will NSA be liable for any damages, including loss of data, lost profits, cost of cover, or other special, incidental, consequential, direct or indirect damages arising from the software or the use thereof, however caused and on any theory of liability. This limitation will apply even if NSA has been advised of the possibility of such damage. You acknowledge that this is a reasonable allocation of risk.", 5 | "name": "libselinux public domain notice", 6 | "licenseId": "libselinux-1.0", 7 | "seeAlso": [ 8 | "https://github.com/SELinuxProject/selinux/blob/master/libselinux/LICENSE" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/ISC.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "isFsfLibre": true, 4 | "licenseText": "ISC License Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. (\"ISC\")\n\nCopyright (c) 1995-2003 by Internet Software Consortium\n\nPermission to use, copy, modify, and /or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", 5 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e \u003c\u003cvar;name\u003d\"title\";original\u003d\"ISC License\";match\u003d\"(The )?ISC License( \\(ISC[L]?\\))?:?\"\u003e\u003e\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. (\"ISC\")\n\nCopyright (c) 1995-2003 by Internet Software Consortium\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, and\u003c\u003cbeginOptional\u003e\u003e /or\u003c\u003cendOptional\u003e\u003e distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND \u003c\u003cvar;name\u003d\"copyrightHolder\";original\u003d\"ISC\";match\u003d\".+\"\u003e\u003e DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL \u003c\u003cvar;name\u003d\"copyrightHolderLiability\";original\u003d\"ISC\";match\u003d\".+\"\u003e\u003e BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", 6 | "name": "ISC License", 7 | "licenseId": "ISC", 8 | "seeAlso": [ 9 | "https://www.isc.org/downloads/software-support-policy/isc-license/", 10 | "https://opensource.org/licenses/ISC" 11 | ], 12 | "isOsiApproved": true 13 | } -------------------------------------------------------------------------------- /assets/database/licenses/Zlib.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "isFsfLibre": true, 4 | "licenseText": "zlib License Copyright (c) \u003cyear\u003e \u003ccopyright holders\u003e\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source distribution.", 5 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e zlib License\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) \u003cyear\u003e \u003ccopyright holders\u003e\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.\";match\u003d\".{0,20}\"\u003e\u003e Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"3.\";match\u003d\".{0,20}\"\u003e\u003e This notice may not be removed or altered from any source distribution.", 6 | "name": "zlib License", 7 | "licenseId": "Zlib", 8 | "seeAlso": [ 9 | "http://www.zlib.net/zlib_license.html", 10 | "https://opensource.org/licenses/Zlib" 11 | ], 12 | "isOsiApproved": true 13 | } -------------------------------------------------------------------------------- /assets/database/licenses/EFL-1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Eiffel Forum License, version 1\n\nPermission is hereby granted to use, copy, modify and/or distribute this package, provided that:\n\n - copyright notices are retained unchanged\n\n - any distribution of this package, whether modified or not, includes this file\n\nPermission is hereby also granted to distribute binary programs which depend on this package, provided that:\n\n - if the binary program depends on a modified version of this package, you must publicly release the modified version of this package\n\nTHIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT WARRANTY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e Eiffel Forum License, version 1\u003c\u003cendOptional\u003e\u003e\n\nPermission is hereby granted to use, copy, modify and/or distribute this package, provided that:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"-\";match\u003d\".{0,20}\"\u003e\u003e copyright notices are retained unchanged\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"-\";match\u003d\".{0,20}\"\u003e\u003e any distribution of this package, whether modified or not, includes this file\n\nPermission is hereby also granted to distribute binary programs which depend on this package, provided that:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"-\";match\u003d\".{0,20}\"\u003e\u003e if the binary program depends on a modified version of this package, you must publicly release the modified version of this package\n\nTHIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT WARRANTY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.", 5 | "name": "Eiffel Forum License v1.0", 6 | "licenseComments": "This license has been superseded by v2.0", 7 | "licenseId": "EFL-1.0", 8 | "seeAlso": [ 9 | "http://www.eiffel-nice.org/license/forum.txt", 10 | "https://opensource.org/licenses/EFL-1.0" 11 | ], 12 | "isOsiApproved": true 13 | } -------------------------------------------------------------------------------- /assets/database/licenses/Noweb.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Noweb is copyright 1989-2000 by Norman Ramsey. All rights reserved.\n\nNoweb is protected by copyright. It is not public-domain software or shareware, and it is not protected by a ``copyleft\u0027\u0027 agreement like the one used by the Free Software Foundation.\n\nNoweb is available free for any use in any field of endeavor. You may redistribute noweb in whole or in part provided you acknowledge its source and include this COPYRIGHT file. You may modify noweb and create derived works, provided you retain this copyright notice, but the result may not be called noweb without my written consent.\n\nYou may sell noweb if you wish. For example, you may sell a CD-ROM including noweb.\n\nYou may sell a derived work, provided that all source code for your derived work is available, at no additional charge, to anyone who buys your derived work in any form. You must give permisson for said source code to be used and modified under the terms of this license. You must state clearly that your work uses or is based on noweb and that noweb is available free of change. You must also request that bug reports on your work be reported to you.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Noweb is copyright 1989-2000 by Norman Ramsey. All rights reserved.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nNoweb is protected by copyright. It is not public-domain software or shareware, and it is not protected by a ``copyleft\u0027\u0027 agreement like the one used by the Free Software Foundation.\n\nNoweb is available free for any use in any field of endeavor. You may redistribute noweb in whole or in part provided you acknowledge its source and include this COPYRIGHT file. You may modify noweb and create derived works, provided you retain this copyright notice, but the result may not be called noweb without my written consent.\n\nYou may sell noweb if you wish. For example, you may sell a CD-ROM including noweb.\n\nYou may sell a derived work, provided that all source code for your derived work is available, at no additional charge, to anyone who buys your derived work in any form. You must give permisson for said source code to be used and modified under the terms of this license. You must state clearly that your work uses or is based on noweb and that noweb is available free of change. You must also request that bug reports on your work be reported to you.", 5 | "name": "Noweb License", 6 | "licenseId": "Noweb", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Noweb" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/Spencer-94.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved.\n\nThis software is not subject to any license of the American Telephone and Telegraph Company or of the Regents of the University of California.\n\nPermission is granted to anyone to use this software for any purpose on any computer system, and to alter it and redistribute it, subject to the following restrictions:\n\n 1. The author is not responsible for the consequences of use of this software, no matter how awful, even if they arise from flaws in it.\n\n 2. The origin of this software must not be misrepresented, either by explicit claim or by omission. Since few users ever read sources, credits must appear in the documentation.\n\n 3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Since few users ever read sources, credits must appear in the documentation.\n\n 4. This notice may not be removed or altered.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved.\u003c\u003cendOptional\u003e\u003e\n\nThis software is not subject to any license of the American Telephone and Telegraph Company or of the Regents of the University of California.\n\nPermission is granted to anyone to use this software for any purpose on any computer system, and to alter it and redistribute it, subject to the following restrictions:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e The author is not responsible for the consequences of use of this software, no matter how awful, even if they arise from flaws in it.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.\";match\u003d\".{0,20}\"\u003e\u003e The origin of this software must not be misrepresented, either by explicit claim or by omission. Since few users ever read sources, credits must appear in the documentation.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"3.\";match\u003d\".{0,20}\"\u003e\u003e Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Since few users ever read sources, credits must appear in the documentation.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"4.\";match\u003d\".{0,20}\"\u003e\u003e This notice may not be removed or altered.", 5 | "name": "Spencer License 94", 6 | "licenseId": "Spencer-94", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/Henry_Spencer_Reg-Ex_Library_License" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/JSON.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "JSON License Copyright (c) 2002 JSON.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nThe Software shall be used for Good, not Evil.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e JSON License\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 2002 JSON.org\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nThe Software shall be used for Good, not Evil.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 5 | "name": "JSON License", 6 | "licenseId": "JSON", 7 | "seeAlso": [ 8 | "http://www.json.org/license.html" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/libtiff.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Copyright (c) 1988-1997 Sam Leffler\n\nCopyright (c) 1991-1997 Silicon Graphics, Inc.\n\nPermission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of Sam Leffler and Silicon Graphics may not be used in any advertising or publicity relating to the software without the specific, prior written permission of Sam Leffler and Silicon Graphics.\n\nTHE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n\nIN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", 4 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 1988-1997 Sam Leffler\n\nCopyright (c) 1991-1997 Silicon Graphics, Inc.\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of Sam Leffler and Silicon Graphics may not be used in any advertising or publicity relating to the software without the specific, prior written permission of Sam Leffler and Silicon Graphics.\n\nTHE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n\nIN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", 5 | "name": "libtiff License", 6 | "licenseId": "libtiff", 7 | "seeAlso": [ 8 | "https://fedoraproject.org/wiki/Licensing/libtiff" 9 | ], 10 | "isOsiApproved": false 11 | } -------------------------------------------------------------------------------- /assets/database/licenses/Linux-OpenIB.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 4 | "standardLicenseTemplate": "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"-\";match\u003d\".{0,20}\"\u003e\u003e Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"-\";match\u003d\".{0,20}\"\u003e\u003e Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 5 | "name": "Linux Kernel Variant of OpenIB.org license", 6 | "licenseComments": "This license is BSD-2-Clause with the MIT disclaimer. The linux kernel uses this license extensively throughout the driver subsystem since 2005. Note that the OpenIB.org license is a true match to BSD-2-Clause.", 7 | "licenseId": "Linux-OpenIB", 8 | "seeAlso": [ 9 | "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/infiniband/core/sa.h" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /assets/database/licenses/MIT-0.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "licenseText": "MIT No Attribution Copyright \u003cYEARr\u003e \u003cCOPYRIGHT HOLDER\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 4 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e \u003c\u003cvar;name\u003d\"title\";original\u003d\"MIT No Attribution\";match\u003d\"The MIT-Zero License|MIT No Attribution|\"\u003e\u003e\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright \u003cYEARr\u003e \u003cCOPYRIGHT HOLDER\u003e\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", 5 | "name": "MIT No Attribution", 6 | "licenseComments": "This license is a modified version of the common MIT license, with the attribution paragraph removed.", 7 | "licenseId": "MIT-0", 8 | "seeAlso": [ 9 | "https://github.com/aws/mit-0", 10 | "https://romanrm.net/mit-zero", 11 | "https://github.com/awsdocs/aws-cloud9-user-guide/blob/master/LICENSE-SAMPLECODE" 12 | ], 13 | "isOsiApproved": false 14 | } -------------------------------------------------------------------------------- /assets/database/licenses/EFL-2.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "isFsfLibre": true, 4 | "licenseText": "Eiffel Forum License, version 2\n\n 1. Permission is hereby granted to use, copy, modify and/or distribute this package, provided that:\n\n - copyright notices are retained unchanged,\n\n - any distribution of this package, whether modified or not, includes this license text.\n\n 2. Permission is hereby also granted to distribute binary programs which depend on this package. If the binary program depends on a modified version of this package, you are encouraged to publicly release the modified version of this package.\n\nTHIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT WARRANTY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.", 5 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e Eiffel Forum License, version 2\u003c\u003cendOptional\u003e\u003e\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e Permission is hereby granted to use, copy, modify and/or distribute this package, provided that:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"-\";match\u003d\".{0,20}\"\u003e\u003e copyright notices are retained unchanged,\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"-\";match\u003d\".{0,20}\"\u003e\u003e any distribution of this package, whether modified or not, includes this license text.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.\";match\u003d\".{0,20}\"\u003e\u003e Permission is hereby also granted to distribute binary programs which depend on this package. If the binary program depends on a modified version of this package, you are encouraged to publicly release the modified version of this package.\n\nTHIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT WARRANTY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.", 6 | "name": "Eiffel Forum License v2.0", 7 | "licenseId": "EFL-2.0", 8 | "seeAlso": [ 9 | "http://www.eiffel-nice.org/license/eiffel-forum-license-2.html", 10 | "https://opensource.org/licenses/EFL-2.0" 11 | ], 12 | "isOsiApproved": true 13 | } -------------------------------------------------------------------------------- /vendor/github.com/BobuSumisu/aho-corasick/trie.go: -------------------------------------------------------------------------------- 1 | package ahocorasick 2 | 3 | const ( 4 | rootState int64 = 1 5 | nilState int64 = 0 6 | ) 7 | 8 | // Trie represents a trie of patterns with extra links as per the Aho-Corasick algorithm. 9 | type Trie struct { 10 | dict []int64 11 | trans [][256]int64 12 | failLink []int64 13 | dictLink []int64 14 | pattern []int64 15 | } 16 | 17 | // Walk calls this function on any match, giving the end position, length of the matched bytes, 18 | // and the pattern number. 19 | type WalkFn func(end, n, pattern int64) bool 20 | 21 | // Walk runs the algorithm on a given output, calling the supplied callback function on every 22 | // match. The algorithm will terminate if the callback function returns false. 23 | func (tr *Trie) Walk(input []byte, fn WalkFn) { 24 | s := rootState 25 | 26 | for i, c := range input { 27 | t := tr.trans[s][c] 28 | 29 | if t == nilState { 30 | for u := tr.failLink[s]; u != rootState; u = tr.failLink[u] { 31 | if t = tr.trans[u][c]; t != nilState { 32 | break 33 | } 34 | } 35 | 36 | if t == nilState { 37 | if t = tr.trans[rootState][c]; t == nilState { 38 | t = rootState 39 | } 40 | } 41 | } 42 | 43 | s = t 44 | 45 | if tr.dict[s] != 0 { 46 | if !fn(int64(i), tr.dict[s], tr.pattern[s]) { 47 | return 48 | } 49 | } 50 | 51 | if tr.dictLink[s] != nilState { 52 | for u := tr.dictLink[s]; u != nilState; u = tr.dictLink[u] { 53 | if !fn(int64(i), tr.dict[u], tr.pattern[u]) { 54 | return 55 | } 56 | } 57 | } 58 | } 59 | } 60 | 61 | // Match runs the Aho-Corasick string-search algorithm on a byte input. 62 | func (tr *Trie) Match(input []byte) []*Match { 63 | matches := make([]*Match, 0) 64 | tr.Walk(input, func(end, n, pattern int64) bool { 65 | pos := end - n + 1 66 | matches = append(matches, newMatch(pos, pattern, input[pos:pos+n])) 67 | return true 68 | }) 69 | return matches 70 | } 71 | 72 | // MatchFirst is the same as Match, but returns after first successful match. 73 | func (tr *Trie) MatchFirst(input []byte) *Match { 74 | var match *Match 75 | tr.Walk(input, func(end, n, pattern int64) bool { 76 | pos := end - n + 1 77 | match = &Match{pos: pos, match: input[pos : pos+n]} 78 | return false 79 | }) 80 | return match 81 | } 82 | 83 | // MatchString runs the Aho-Corasick string-search algorithm on a string input. 84 | func (tr *Trie) MatchString(input string) []*Match { 85 | return tr.Match([]byte(input)) 86 | } 87 | 88 | // MatchFirstString is the same as MatchString, but returns after first successful match. 89 | func (tr *Trie) MatchFirstString(input string) *Match { 90 | return tr.MatchFirst([]byte(input)) 91 | } 92 | -------------------------------------------------------------------------------- /assets/database/licenses/SMLNJ.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "isFsfLibre": true, 4 | "licenseText": "STANDARD ML OF NEW JERSEY COPYRIGHT NOTICE, LICENSE AND DISCLAIMER. Copyright (c) 2001-2011 by The Fellowship of SML/NJ\n\nCopyright (c) 1989-2001 by Lucent Technologies\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of Lucent Technologies, Bell Labs or any Lucent entity not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.\n\nLucent disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall Lucent be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.", 5 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e STANDARD ML OF NEW JERSEY COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 2001-2011 by The Fellowship of SML/NJ\n\nCopyright (c) 1989-2001 by Lucent Technologies\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of Lucent Technologies, Bell Labs or any Lucent entity not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.\n\nLucent disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall Lucent be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.", 6 | "name": "Standard ML of New Jersey License", 7 | "licenseId": "SMLNJ", 8 | "seeAlso": [ 9 | "https://www.smlnj.org/license.html" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /assets/database/licenses/StandardML-NJ.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": true, 3 | "isFsfLibre": true, 4 | "licenseText": "STANDARD ML OF NEW JERSEY COPYRIGHT NOTICE, LICENSE AND DISCLAIMER. Copyright (c) 2001-2011 by The Fellowship of SML/NJ\n\nCopyright (c) 1989-2001 by Lucent Technologies\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of Lucent Technologies, Bell Labs or any Lucent entity not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.\n\nLucent disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall Lucent be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.", 5 | "standardLicenseTemplate": "\u003c\u003cbeginOptional\u003e\u003e STANDARD ML OF NEW JERSEY COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.\u003c\u003cendOptional\u003e\u003e \u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright (c) 2001-2011 by The Fellowship of SML/NJ\n\nCopyright (c) 1989-2001 by Lucent Technologies\";match\u003d\".{0,1000}\"\u003e\u003e\n\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of Lucent Technologies, Bell Labs or any Lucent entity not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.\n\nLucent disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall Lucent be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.", 6 | "name": "Standard ML of New Jersey License", 7 | "licenseId": "StandardML-NJ", 8 | "seeAlso": [ 9 | "http://www.smlnj.org//license.html" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /assets/database/licenses/Nunit.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": true, 3 | "isFsfLibre": true, 4 | "licenseText": "Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole\n\nCopyright © 2000-2004 Philip A. Craig\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.\n\n Portions Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole or Copyright © 2000-2004 Philip A. Craig\n\n 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source distribution.", 5 | "standardLicenseTemplate": "\u003c\u003cvar;name\u003d\"copyright\";original\u003d\"Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole\n\nCopyright © 2000-2004 Philip A. Craig\";match\u003d\".{0,1000}\"\u003e\u003e\n\nThis software is provided \u0027as-is\u0027, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"1.\";match\u003d\".{0,20}\"\u003e\u003e The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.\n\n Portions Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole or Copyright © 2000-2004 Philip A. Craig\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"2.\";match\u003d\".{0,20}\"\u003e\u003e Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n\n \u003c\u003cvar;name\u003d\"bullet\";original\u003d\"3.\";match\u003d\".{0,20}\"\u003e\u003e This notice may not be removed or altered from any source distribution.", 6 | "name": "Nunit License", 7 | "licenseId": "Nunit", 8 | "seeAlso": [ 9 | "https://fedoraproject.org/wiki/Licensing/Nunit" 10 | ], 11 | "isOsiApproved": false 12 | } -------------------------------------------------------------------------------- /assets/database/licenses/Unlicense.json: -------------------------------------------------------------------------------- 1 | { 2 | "isDeprecatedLicenseId": false, 3 | "isFsfLibre": true, 4 | "licenseText": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.\n\nIn jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to \u003chttps://unlicense.org/\u003e", 5 | "standardLicenseTemplate": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.\n\nIn jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\u003c\u003cbeginOptional\u003e\u003e For more information, please refer to \u003chttps://unlicense.org/\u003e\u003c\u003cendOptional\u003e\u003e", 6 | "name": "The Unlicense", 7 | "licenseComments": "This is a public domain dedication", 8 | "licenseId": "Unlicense", 9 | "seeAlso": [ 10 | "https://unlicense.org/" 11 | ], 12 | "isOsiApproved": false 13 | } --------------------------------------------------------------------------------