Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Go modules #219

Merged
merged 6 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 8 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dist: trusty

language: go
go_import_path: gopkg.in/src-d/enry.v1

go:
- '1.11.6' # specific versions until https://github.com/golang/go/issues/31293
- '1.12.1'
- '1.12.x'
- '1.11.x'
env:
global:
- GO_VERSION_FOR_JVM='1.11.1'
- GO_VERSION_FOR_JVM='1.11.x'
- CGO_ENABLED=0
- GO111MODULE=on
matrix:
- ONIGURUMA=0
- ONIGURUMA=1
Expand All @@ -32,10 +32,9 @@ stage: test
install:
- >
if [[ "${ONIGURUMA}" -gt 0 ]]; then
export tags="${tags} oniguruma";
export CGO_ENABLED=1;
export GO_TAGS='oniguruma';
fi;
- go get -v -t -tags "${tags}" ./...
script:
- make test-coverage
after_success:
Expand All @@ -47,19 +46,10 @@ jobs:
stage: test
language: scala
jdk: oraclejdk8
before_install:
- export CGO_ENABLED=1
# mimics exact behavior of 'go_import_path' for non-go build image
- export GOPATH=${TRAVIS_HOME}/gopath
- mkdir -p ${GOPATH}/src/gopkg.in/src-d/enry.v1
- tar -Pczf ${TRAVIS_TMPDIR}/src_archive.tar.gz -C ${TRAVIS_BUILD_DIR} . && tar -Pxzf ${TRAVIS_TMPDIR}/src_archive.tar.gz -C ${TRAVIS_HOME}/gopath/src/gopkg.in/src-d/enry.v1
- export TRAVIS_BUILD_DIR=${TRAVIS_HOME}/gopath/src/gopkg.in/src-d/enry.v1
- cd ${TRAVIS_HOME}/gopath/src/gopkg.in/src-d/enry.v1
install:
- export CGO_ENABLED=1
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=$GO_VERSION_FOR_JVM bash)"
- go version
- echo $PWD; echo $GOPATH
- go get -v ./...
before_script:
- cd java
- make
Expand All @@ -70,7 +60,6 @@ jobs:
stage: release
install:
- go version
- go get -v -t ./...
script: make packages
deploy:
provider: releases
Expand All @@ -86,7 +75,6 @@ jobs:
stage: release
install:
- go version
- go get -v -t ./...
script: make linux-shared
deploy:
provider: releases
Expand All @@ -100,19 +88,17 @@ jobs:

- name: 'macOS shared lib'
stage: release
sudo: true
env:
- OSXCROSS_PACKAGE="osxcross_3034f7149716d815bc473d0a7b35d17e4cf175aa.tar.gz"
- OSXCROSS_URL="https://github.com/bblfsh/client-scala/releases/download/v1.5.2/${OSXCROSS_PACKAGE}"
- PATH="/$HOME/osxcross/bin:$PATH"
install:
- go version
- go get -v -t ./...
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends clang g++ gcc gcc-multilib libc6-dev libc6-dev-i386 mingw-w64 patch xz-utils
- cd ${HOME}
- curl -sfSL ${OSXCROSS_URL} | tar -C ${HOME} -xzf -
- cd $GOPATH/src/gopkg.in/src-d/enry.v1
- cd $GOPATH/src/github.com/src-d/enry
script: make darwin-shared
deploy:
provider: releases
Expand All @@ -127,18 +113,10 @@ jobs:
stage: publish
language: scala
jdk: oraclejdk8
before_install:
- export CGO_ENABLED=1
# mimics exact behavior of 'go_import_path' for non-go build image
- export GOPATH=${TRAVIS_HOME}/gopath
- mkdir -p ${GOPATH}/src/gopkg.in/src-d/enry.v1
- tar -Pczf ${TRAVIS_TMPDIR}/src_archive.tar.gz -C ${TRAVIS_BUILD_DIR} . && tar -Pxzf ${TRAVIS_TMPDIR}/src_archive.tar.gz -C ${TRAVIS_HOME}/gopath/src/gopkg.in/src-d/enry.v1
- export TRAVIS_BUILD_DIR=${TRAVIS_HOME}/gopath/src/gopkg.in/src-d/enry.v1
- cd ${TRAVIS_HOME}/gopath/src/gopkg.in/src-d/enry.v1
install:
- export CGO_ENABLED=1
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=$GO_VERSION_FOR_JVM bash)"
- go version
- go get -v -t ./...
before_script:
- cd java
- make
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# enry [![GoDoc](https://godoc.org/gopkg.in/src-d/enry.v1?status.svg)](https://godoc.org/gopkg.in/src-d/enry.v1) [![Build Status](https://travis-ci.com/src-d/enry.svg?branch=master)](https://travis-ci.com/src-d/enry) [![codecov](https://codecov.io/gh/src-d/enry/branch/master/graph/badge.svg)](https://codecov.io/gh/src-d/enry)
# enry [![GoDoc](https://godoc.org/github.com/src-d/enry?status.svg)](https://godoc.org/github.com/src-d/enry) [![Build Status](https://travis-ci.com/src-d/enry.svg?branch=master)](https://travis-ci.com/src-d/enry) [![codecov](https://codecov.io/gh/src-d/enry/branch/master/graph/badge.svg)](https://codecov.io/gh/src-d/enry)

File programming language detector and toolbox to ignore binary or vendored files. *enry*, started as a port to _Go_ of the original [linguist](https://github.com/github/linguist) _Ruby_ library, that has an improved *2x performance*.

Expand All @@ -9,7 +9,7 @@ Installation
The recommended way to install enry is

```
go get gopkg.in/src-d/enry.v1/cmd/enry
go get github.com/src-d/enry/cmd/enry
```

To build enry's CLI you must run
Expand Down
2 changes: 1 addition & 1 deletion benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path/filepath"
"testing"

"gopkg.in/src-d/enry.v1/data"
"github.com/src-d/enry/v2/data"
)

type sample struct {
Expand Down
2 changes: 1 addition & 1 deletion classifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math"
"sort"

"gopkg.in/src-d/enry.v1/internal/tokenizer"
"github.com/src-d/enry/v2/internal/tokenizer"
)

// Classifier is the interface in charge to detect the possible languages of the given content based on a set of
Expand Down
4 changes: 2 additions & 2 deletions cmd/enry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"sort"
"strings"

"gopkg.in/src-d/enry.v1"
"gopkg.in/src-d/enry.v1/data"
"github.com/src-d/enry/v2"
"github.com/src-d/enry/v2/data"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"
"strings"

"gopkg.in/src-d/enry.v1/data"
"gopkg.in/src-d/enry.v1/regex"
"github.com/src-d/enry/v2/data"
"github.com/src-d/enry/v2/regex"
)

// OtherLanguage is used as a zero value when a function can not return a specific language.
Expand Down
2 changes: 1 addition & 1 deletion common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"path/filepath"
"testing"

"gopkg.in/src-d/enry.v1/data"
"github.com/src-d/enry/v2/data"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion data/alias.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/commit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions data/content.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/documentation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/extension.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/filename.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/frequencies.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
2 changes: 1 addition & 1 deletion data/heuristics.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package data

import "gopkg.in/src-d/enry.v1/data/rule"
import "github.com/src-d/enry/v2/data/rule"

// Heuristics implements a rule-based content matching engine.

Expand Down
2 changes: 1 addition & 1 deletion data/heuristics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"regexp"
"testing"

"github.com/src-d/enry/v2/data/rule"
"github.com/stretchr/testify/assert"
"gopkg.in/src-d/enry.v1/data/rule"
)

var testContentHeuristics = map[string]*Heuristics{
Expand Down
2 changes: 1 addition & 1 deletion data/interpreter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/mimeType.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/type.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/vendor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion enry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
Upstream Linguist YAML files are used to generate datastructures for data
package.
*/
package enry // import "gopkg.in/src-d/enry.v1"
package enry // import "github.com/src-d/enry"

//go:generate make code-generate
11 changes: 11 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/src-d/enry/v2

go 1.12

require (
github.com/src-d/go-oniguruma v1.0.0
github.com/stretchr/testify v1.3.0
github.com/toqueteos/trie v1.0.0 // indirect
gopkg.in/toqueteos/substring.v1 v1.0.2
gopkg.in/yaml.v2 v2.2.2
)
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/src-d/go-oniguruma v1.0.0 h1:JDk5PUAjreGsGAKLsoDLNmrsaryjJ5RqT3h+Si6aw/E=
github.com/src-d/go-oniguruma v1.0.0/go.mod h1:chVbff8kcVtmrhxtZ3yBVLLquXbzCS6DrxQaAK/CeqM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/toqueteos/trie v1.0.0 h1:8i6pXxNUXNRAqP246iibb7w/pSFquNTQ+uNfriG7vlk=
github.com/toqueteos/trie v1.0.0/go.mod h1:Ywk48QhEqhU1+DwhMkJ2x7eeGxDHiGkAdc9+0DYcbsM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/toqueteos/substring.v1 v1.0.2 h1:urLqCeMm6x/eTuQa1oZerNw8N1KNOIp5hD5kGL7lFsE=
gopkg.in/toqueteos/substring.v1 v1.0.2/go.mod h1:Eb2Z1UYehlVK8LYW2WBVR2rwbujsz3aX8XDrM1vbNew=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion internal/code-generator/assets/content.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package data
import (
"regexp"

"gopkg.in/src-d/enry.v1/data/rule"
"github.com/src-d/enry/v2/data/rule"
)

var ContentHeuristics = map[string]*Heuristics{
Expand Down
2 changes: 1 addition & 1 deletion internal/code-generator/assets/header.go.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: {{ getCommit }}

2 changes: 1 addition & 1 deletion internal/code-generator/generator/samplesfreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strconv"
"text/template"

"gopkg.in/src-d/enry.v1/internal/tokenizer"
"github.com/src-d/enry/v2/internal/tokenizer"
)

type samplesFrequencies struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/code-generator/generator/test_files/alias.gold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
2 changes: 1 addition & 1 deletion internal/code-generator/generator/test_files/commit.gold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
4 changes: 2 additions & 2 deletions internal/code-generator/generator/test_files/content.gold
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data

import (
"regexp"

"gopkg.in/src-d/enry.v1/data/rule"
"github.com/src-d/enry/v2/data/rule"
)

var ContentHeuristics = map[string]*Heuristics{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
2 changes: 1 addition & 1 deletion internal/code-generator/generator/test_files/filename.gold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
2 changes: 1 addition & 1 deletion internal/code-generator/generator/test_files/mimeType.gold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
2 changes: 1 addition & 1 deletion internal/code-generator/generator/test_files/type.gold
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT.
// Code generated by github.com/src-d/enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db

package data
Expand Down
Loading