Skip to content

Commit

Permalink
Merge pull request #62 from vmarkovtsev/master
Browse files Browse the repository at this point in the history
v3
  • Loading branch information
vmarkovtsev committed Sep 13, 2019
2 parents e550631 + 4ba8be6 commit 7961dd6
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -2,7 +2,7 @@ dist: trusty


language: go language: go


go_import_path: gopkg.in/src-d/go-license-detector.v2 go_import_path: gopkg.in/src-d/go-license-detector.v3
go: go:
- 1.11.x - 1.11.x
- 1.12.x - 1.12.x
Expand All @@ -19,13 +19,13 @@ install:
- export GO111MODULE=on - export GO111MODULE=on
- make - make
- go mod vendor - go mod vendor
- go build -v gopkg.in/src-d/go-license-detector.v2/cmd/license-detector - go build -v gopkg.in/src-d/go-license-detector.v3/cmd/license-detector


script: script:
- go vet ./... - go vet ./...
- lint_warns=$(golint ./... | grep -v vendor/) || true - lint_warns=$(golint ./... | grep -v vendor/) || true
- if [ ! -z "$lint_warns" ]; then echo "$lint_warns"; exit 1; fi - if [ ! -z "$lint_warns" ]; then echo "$lint_warns"; exit 1; fi
- goverage -cpu=1,2 -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/go-license-detector.v2/... - goverage -cpu=1,2 -coverprofile=coverage.txt -covermode=count gopkg.in/src-d/go-license-detector.v3/...
- sed -i '/assets/d' coverage.txt - sed -i '/assets/d' coverage.txt


after_success: after_success:
Expand Down
12 changes: 6 additions & 6 deletions README.md
@@ -1,4 +1,4 @@
# go-license-detector [![GoDoc](https://godoc.org/gopkg.in/src-d/go-license-detector.v2?status.svg)](http://godoc.org/gopkg.in/src-d/go-license-detector.v2) [![Build Status](https://travis-ci.com/src-d/go-license-detector.svg?branch=master)](https://travis-ci.com/src-d/go-license-detector) [![Build status](https://ci.appveyor.com/api/projects/status/bxixhg99ewcgc5i5?svg=true)](https://ci.appveyor.com/project/vmarkovtsev/go-license-detector) [![codecov](https://codecov.io/github/src-d/go-license-detector/coverage.svg)](https://codecov.io/gh/src-d/go-license-detector) [![Go Report Card](https://goreportcard.com/badge/github.com/src-d/go-license-detector)](https://goreportcard.com/report/github.com/src-d/go-license-detector) # go-license-detector [![GoDoc](https://godoc.org/gopkg.in/src-d/go-license-detector.v3?status.svg)](http://godoc.org/gopkg.in/src-d/go-license-detector.v3) [![Build Status](https://travis-ci.com/src-d/go-license-detector.svg?branch=master)](https://travis-ci.com/src-d/go-license-detector) [![Build status](https://ci.appveyor.com/api/projects/status/bxixhg99ewcgc5i5?svg=true)](https://ci.appveyor.com/project/vmarkovtsev/go-license-detector) [![codecov](https://codecov.io/github/src-d/go-license-detector/coverage.svg)](https://codecov.io/gh/src-d/go-license-detector) [![Go Report Card](https://goreportcard.com/badge/github.com/src-d/go-license-detector)](https://goreportcard.com/report/github.com/src-d/go-license-detector)


Project license detector - a command line application and a library, written in Go. Project license detector - a command line application and a library, written in Go.
It scans the given directory for license files, normalizes and hashes them and outputs It scans the given directory for license files, normalizes and hashes them and outputs
Expand All @@ -20,7 +20,7 @@ The intended area of it's usage is data mining.
``` ```
export GO111MODULE=on export GO111MODULE=on
go mod download go mod download
go build -v gopkg.in/src-d/go-license-detector.v2/cmd/license-detector go build -v gopkg.in/src-d/go-license-detector.v3/cmd/license-detector
``` ```


## Contributions ## Contributions
Expand Down Expand Up @@ -67,8 +67,8 @@ Library (for a single license detection):


```go ```go
import ( import (
   "gopkg.in/src-d/go-license-detector.v2/licensedb"    "gopkg.in/src-d/go-license-detector.v3/licensedb"
"gopkg.in/src-d/go-license-detector.v2/licensedb/filer" "gopkg.in/src-d/go-license-detector.v3/licensedb/filer"
) )


func main() { func main() {
Expand All @@ -83,7 +83,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"


"gopkg.in/src-d/go-license-detector.v2/licensedb" "gopkg.in/src-d/go-license-detector.v3/licensedb"
) )


func main() { func main() {
Expand Down Expand Up @@ -115,7 +115,7 @@ Comparison to other projects on that dataset:
|[LiD](https://source.codeaurora.org/external/qostg/lid)| 94% (847/902) | 3660 | |[LiD](https://source.codeaurora.org/external/qostg/lid)| 94% (847/902) | 3660 |


<details><summary>How this was measured</summary> <details><summary>How this was measured</summary>
<pre><code>$ cd $(go env GOPATH)/src/gopkg.in/src-d/go-license-detector.v2/licensedb <pre><code>$ cd $(go env GOPATH)/src/gopkg.in/src-d/go-license-detector.v3/licensedb
$ mkdir dataset && cd dataset $ mkdir dataset && cd dataset
$ unzip ../dataset.zip $ unzip ../dataset.zip
$ # src-d/go-license-detector $ # src-d/go-license-detector
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Expand Up @@ -7,8 +7,8 @@ environment:


build_script: build_script:
- go mod vendor - go mod vendor
- go build -v gopkg.in/src-d/go-license-detector.v2/cmd/license-detector - go build -v gopkg.in/src-d/go-license-detector.v3/cmd/license-detector
- go test gopkg.in/src-d/go-license-detector.v2/... - go test gopkg.in/src-d/go-license-detector.v3/...
- 7z a license-detector.windows_amd64.zip license-detector.exe - 7z a license-detector.windows_amd64.zip license-detector.exe


artifacts: artifacts:
Expand Down
2 changes: 1 addition & 1 deletion cmd/license-detector/main.go
Expand Up @@ -11,7 +11,7 @@ import (
"os" "os"


"github.com/spf13/pflag" "github.com/spf13/pflag"
"gopkg.in/src-d/go-license-detector.v2/licensedb" "gopkg.in/src-d/go-license-detector.v3/licensedb"
) )


func main() { func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/license-detector/main_test.go
Expand Up @@ -6,7 +6,7 @@ import (
"testing" "testing"


"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"gopkg.in/src-d/go-license-detector.v2/licensedb" "gopkg.in/src-d/go-license-detector.v3/licensedb"
) )


func TestCmdMain(t *testing.T) { func TestCmdMain(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,4 +1,4 @@
module gopkg.in/src-d/go-license-detector.v2 module gopkg.in/src-d/go-license-detector.v3


require ( require (
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect
Expand Down
2 changes: 1 addition & 1 deletion licensedb/analysis.go
Expand Up @@ -6,7 +6,7 @@ import (
"sort" "sort"
"sync" "sync"


"gopkg.in/src-d/go-license-detector.v2/licensedb/filer" "gopkg.in/src-d/go-license-detector.v3/licensedb/filer"
) )


// Analyse runs license analysis on each item in `args` // Analyse runs license analysis on each item in `args`
Expand Down
4 changes: 2 additions & 2 deletions licensedb/dataset_test.go
Expand Up @@ -6,8 +6,8 @@ import (
"sync" "sync"
"testing" "testing"


"gopkg.in/src-d/go-license-detector.v2/licensedb/api" "gopkg.in/src-d/go-license-detector.v3/licensedb/api"
"gopkg.in/src-d/go-license-detector.v2/licensedb/filer" "gopkg.in/src-d/go-license-detector.v3/licensedb/filer"


"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
Expand Down
10 changes: 5 additions & 5 deletions licensedb/internal/db.go
Expand Up @@ -17,11 +17,11 @@ import (
"github.com/ekzhu/minhash-lsh" "github.com/ekzhu/minhash-lsh"
"github.com/sergi/go-diff/diffmatchpatch" "github.com/sergi/go-diff/diffmatchpatch"


"gopkg.in/src-d/go-license-detector.v2/licensedb/filer" "gopkg.in/src-d/go-license-detector.v3/licensedb/filer"
"gopkg.in/src-d/go-license-detector.v2/licensedb/internal/assets" "gopkg.in/src-d/go-license-detector.v3/licensedb/internal/assets"
"gopkg.in/src-d/go-license-detector.v2/licensedb/internal/fastlog" "gopkg.in/src-d/go-license-detector.v3/licensedb/internal/fastlog"
"gopkg.in/src-d/go-license-detector.v2/licensedb/internal/normalize" "gopkg.in/src-d/go-license-detector.v3/licensedb/internal/normalize"
"gopkg.in/src-d/go-license-detector.v2/licensedb/internal/wmh" "gopkg.in/src-d/go-license-detector.v3/licensedb/internal/wmh"
) )


var ( var (
Expand Down
6 changes: 3 additions & 3 deletions licensedb/internal/investigation.go
Expand Up @@ -8,9 +8,9 @@ import (
"strings" "strings"
"sync" "sync"


"gopkg.in/src-d/go-license-detector.v2/licensedb/api" "gopkg.in/src-d/go-license-detector.v3/licensedb/api"
"gopkg.in/src-d/go-license-detector.v2/licensedb/filer" "gopkg.in/src-d/go-license-detector.v3/licensedb/filer"
"gopkg.in/src-d/go-license-detector.v2/licensedb/internal/processors" "gopkg.in/src-d/go-license-detector.v3/licensedb/internal/processors"
) )


var ( var (
Expand Down
2 changes: 1 addition & 1 deletion licensedb/internal/wmh/wmh.go
Expand Up @@ -10,7 +10,7 @@ import (


"golang.org/x/exp/rand" "golang.org/x/exp/rand"
"gonum.org/v1/gonum/stat/distuv" "gonum.org/v1/gonum/stat/distuv"
"gopkg.in/src-d/go-license-detector.v2/licensedb/internal/fastlog" "gopkg.in/src-d/go-license-detector.v3/licensedb/internal/fastlog"
) )


const maxUint16 = 65535 const maxUint16 = 65535
Expand Down
6 changes: 3 additions & 3 deletions licensedb/licensedb.go
Expand Up @@ -4,9 +4,9 @@ import (
"errors" "errors"
paths "path" paths "path"


"gopkg.in/src-d/go-license-detector.v2/licensedb/api" "gopkg.in/src-d/go-license-detector.v3/licensedb/api"
"gopkg.in/src-d/go-license-detector.v2/licensedb/filer" "gopkg.in/src-d/go-license-detector.v3/licensedb/filer"
"gopkg.in/src-d/go-license-detector.v2/licensedb/internal" "gopkg.in/src-d/go-license-detector.v3/licensedb/internal"
) )


var ( var (
Expand Down

0 comments on commit 7961dd6

Please sign in to comment.