Skip to content

Commit

Permalink
update licensedb dep (#2337)
Browse files Browse the repository at this point in the history
* update licensedb

Signed-off-by: Alex Pana <[email protected]>

* run make gen

Signed-off-by: Alex Pana <[email protected]>

Signed-off-by: Alex Pana <[email protected]>
  • Loading branch information
acpana authored Jan 24, 2023
1 parent 52d01c2 commit 4054415
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 319 deletions.
15 changes: 11 additions & 4 deletions cmd/license-lint/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"fmt"
"os"

"gopkg.in/src-d/go-license-detector.v2/licensedb"
"gopkg.in/src-d/go-license-detector.v2/licensedb/filer"
"github.com/go-enry/go-license-detector/v4/licensedb"
"github.com/go-enry/go-license-detector/v4/licensedb/filer"
)

// analysisResult describes a license.
Expand Down Expand Up @@ -49,8 +49,15 @@ func (f *filerImpl) ReadDir(dir string) ([]filer.File, error) {
return []filer.File{{Name: f.License}}, nil
}

// Close frees all the resources allocated by this Filer.
func (f *filerImpl) Close() {}

// PathsAreAlwaysSlash indicates whether the path separator is platform-independent ("/") or
// OS-specific.
func (f *filerImpl) PathsAreAlwaysSlash() bool {
return false
}

func analyzeLicense(path string) (analysisResult, error) {
res, err := licensedb.Detect(&filerImpl{License: path})
if err == licensedb.ErrNoLicenseFound {
Expand All @@ -63,8 +70,8 @@ func analyzeLicense(path string) (analysisResult, error) {
var confidence float32
licenseName := ""
for id, v := range res {
if v > confidence {
confidence = v
if v.Confidence > confidence {
confidence = v.Confidence
licenseName = id
}
}
Expand Down
30 changes: 10 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/emicklei/proto v1.11.0
github.com/getkin/kin-openapi v0.106.0
github.com/go-enry/go-license-detector/v4 v4.3.0
github.com/golang/glog v1.0.0
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.9
Expand All @@ -23,7 +24,6 @@ require (
golang.org/x/tools v0.2.0
google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55
google.golang.org/protobuf v1.28.1
gopkg.in/src-d/go-license-detector.v2 v2.0.0-20180510072912-da552ecf050b
gopkg.in/yaml.v2 v2.4.0
istio.io/api v0.0.0-20221021152446-f26e759dd372
k8s.io/apiextensions-apiserver v0.26.0
Expand All @@ -37,24 +37,22 @@ require (
require (
cloud.google.com/go v0.102.1 // indirect
cloud.google.com/go/compute v1.7.0 // indirect
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 // indirect
github.com/cockroachdb/apd/v2 v2.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc // indirect
github.com/dgryski/go-minhash v0.0.0-20170608043002-7fe510aff544 // indirect
github.com/dgryski/go-spooky v0.0.0-20170606183049-ed3d087f40e2 // indirect
github.com/ekzhu/minhash-lsh v0.0.0-20171225071031-5c06ee8586a1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gliderlabs/ssh v0.2.2 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.0.0 // indirect
github.com/go-git/go-git/v5 v5.1.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
Expand All @@ -69,13 +67,14 @@ require (
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hhatto/gorst v0.0.0-20181029133204-ca9f730cac5b // indirect
github.com/imdario/mergo v0.3.9 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jdkato/prose v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand All @@ -87,8 +86,6 @@ require (
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808 // indirect
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de // indirect
github.com/neurosnap/sentences v1.0.6 // indirect
github.com/pelletier/go-buffruneio v0.3.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -98,18 +95,17 @@ require (
github.com/prometheus/procfs v0.8.0 // indirect
github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/shogo82148/go-shuffle v0.0.0-20180218125048-27e6095f230d // indirect
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/xanzy/ssh-agent v0.2.0 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
go.opencensus.io v0.23.0 // indirect
Expand All @@ -121,20 +117,14 @@ require (
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
gonum.org/v1/gonum v0.6.0 // indirect
gonum.org/v1/gonum v0.7.0 // indirect
gonum.org/v1/netlib v0.0.0-20191031114514-eccb95939662 // indirect
google.golang.org/api v0.96.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/grpc v1.50.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/neurosnap/sentences.v1 v1.0.6 // indirect
gopkg.in/russross/blackfriday.v2 v2.0.0 // indirect
gopkg.in/src-d/go-billy-siva.v4 v4.2.2 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.0 // indirect
gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 // indirect
gopkg.in/src-d/go-git.v4 v4.7.0 // indirect
gopkg.in/src-d/go-siva.v1 v1.3.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
Expand Down
Loading

0 comments on commit 4054415

Please sign in to comment.