*: module rename to go-enry/go-enry/v4

This commit is contained in:
Máximo Cuadros 2020-03-19 17:31:29 +01:00
parent bc5e031cee
commit 84efad7693
No known key found for this signature in database
GPG Key ID: 17A5DFEDC735AE4B
50 changed files with 60 additions and 172 deletions

View File

@ -1 +0,0 @@
* @src-d/language-analysis

View File

@ -1,61 +0,0 @@
# source{d} Contributing Guidelines
source{d} projects accept contributions via GitHub pull requests.
This document outlines some of the
conventions on development workflow, commit message formatting, contact points,
and other resources to make it easier to get your contribution accepted.
## Certificate of Origin
By contributing to this project, you agree to the [Developer Certificate of
Origin (DCO)](DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the
contribution.
In order to show your agreement with the DCO you should include at the end of the commit message,
the following line: `Signed-off-by: John Doe <john.doe@example.com>`, using your real name.
This can be done easily using the [`-s`](https://github.com/git/git/blob/b2c150d3aa82f6583b9aadfecc5f8fa1c74aca09/Documentation/git-commit.txt#L154-L161) flag on the `git commit`.
If you find yourself pushed a few commits without `Signed-off-by`, you can still add it afterwards. We wrote a manual which can help: [fix-DCO.md](https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md).
## Support Channels
The official support channels, for both users and contributors, are:
- GitHub issues: each repository has its own list of issues.
- Slack: join the [source{d} Slack](https://join.slack.com/t/sourced-community/shared_invite/enQtMjc4Njk5MzEyNzM2LTFjNzY4NjEwZGEwMzRiNTM4MzRlMzQ4MmIzZjkwZmZlM2NjODUxZmJjNDI1OTcxNDAyMmZlNmFjODZlNTg0YWM) community.
*Before opening a new issue or submitting a new pull request, it's helpful to
search the project - it's likely that another user has already reported the
issue you're facing, or it's a known issue that we're already aware of.
## How to Contribute
Pull Requests (PRs) are the main and exclusive way to contribute code to source{d} projects.
In order for a PR to be accepted it needs to pass this list of requirements:
- The contribution must be correctly explained with natural language and providing a minimum working example that reproduces it.
- All PRs must be written idiomaticly:
- for Go: formatted according to [gofmt](https://golang.org/cmd/gofmt/), and without any warnings from [go lint](https://github.com/golang/lint) nor [go vet](https://golang.org/cmd/vet/)
- for other languages, similar constraints apply.
- They should in general include tests, and those shall pass.
- If the PR is a bug fix, it has to include a new unit test that fails before the patch is merged.
- If the PR is a new feature, it has to come with a suite of unit tests, that tests the new functionality.
- In any case, all the PRs have to pass the personal evaluation of at least one of the [maintainers](MAINTAINERS) of the project.
### Format of the commit message
Every commit message should describe what was changed, under which context and, if applicable, the GitHub issue it relates to:
```
plumbing: packp, Skip argument validations for unknown capabilities. Fixes #623
```
The format can be described more formally as follows:
```
<package>: <subpackage>, <what changed>. [Fixes #<issue-number>]
```

25
DCO
View File

@ -1,25 +0,0 @@
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

View File

@ -1,3 +1,4 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@ -178,7 +179,7 @@
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
@ -186,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2017 Sourced Technologies, S.L.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -198,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.

View File

@ -1,3 +0,0 @@
Alexander Bezzubov <alex@sourced.tech> (@bzz)
Michael Fromberger <michael@sourced.tech> (@creachadair)
Kuba Podgórski <kuba@sourced.tech> (@kuba--)

View File

@ -1,26 +1,3 @@
# Package configuration
PROJECT = enry
COMMANDS = cmd/enry
# Including ci Makefile
CI_REPOSITORY ?= https://github.com/src-d/ci.git
CI_BRANCH ?= v1
CI_PATH ?= .ci
MAKEFILE := $(CI_PATH)/Makefile.main
$(MAKEFILE):
git clone --quiet --depth 1 -b $(CI_BRANCH) $(CI_REPOSITORY) $(CI_PATH);
-include $(MAKEFILE)
# Docsrv: configure the languages whose api-doc can be auto generated
LANGUAGES = go
# Docs: do not edit this
DOCS_REPOSITORY := https://github.com/src-d/docs
SHARED_PATH ?= $(shell pwd)/.docsrv-resources
DOCS_PATH ?= $(SHARED_PATH)/.docs
$(DOCS_PATH)/Makefile.inc:
git clone --quiet --depth 1 $(DOCS_REPOSITORY) $(DOCS_PATH);
-include $(DOCS_PATH)/Makefile.inc
LINGUIST_PATH = .linguist
# shared objects

View File

@ -21,7 +21,7 @@ The recommended way to install the `enry` command-line tool is to either
[download a release](https://github.com/bzz/enry/releases) or run:
```
(cd "$(mktemp -d)" && go mod init enry && go get github.com/bzz/enry/v2/cmd/enry)
(cd "$(mktemp -d)" && go mod init enry && go get github.com/go-enry/go-enry/v2/cmd/enry)
```
*enry* CLI accepts similar flags (`--breakdown/--json`) and produce an output, similar to *linguist*:
@ -50,7 +50,7 @@ In a [Go module](https://github.com/golang/go/wiki/Modules),
import `enry` to the module by running:
```go
go get github.com/bzz/enry/v2
go get github.com/go-enry/go-enry/v2
```
The rest of the examples will assume you have either done this or fetched the
@ -58,7 +58,7 @@ library into your `GOPATH`.
```go
// The examples here and below assume you have imported the library.
import "github.com/bzz/enry/v2"
import "github.com/go-enry/go-enry/v2"
lang, safe := enry.GetLanguageByExtension("foo.go")
fmt.Println(lang, safe)

View File

@ -10,7 +10,7 @@ import (
"path/filepath"
"testing"
"github.com/bzz/enry/v2/data"
"github.com/go-enry/go-enry/v2/data"
)
type sample struct {

View File

@ -4,7 +4,7 @@ import (
"math"
"sort"
"github.com/bzz/enry/v2/internal/tokenizer"
"github.com/go-enry/go-enry/v2/internal/tokenizer"
)
// classifier is the interface in charge to detect the possible languages of the given content based on a set of

View File

@ -14,8 +14,8 @@ import (
"sort"
"strings"
"github.com/bzz/enry/v2"
"github.com/bzz/enry/v2/data"
"github.com/go-enry/go-enry/v2"
"github.com/go-enry/go-enry/v2/data"
)
var (

View File

@ -6,8 +6,8 @@ import (
"path/filepath"
"strings"
"github.com/bzz/enry/v2/data"
"github.com/bzz/enry/v2/regex"
"github.com/go-enry/go-enry/v2/data"
"github.com/go-enry/go-enry/v2/regex"
)
// OtherLanguage is used as a zero value when a function can not return a specific language.

View File

@ -8,7 +8,7 @@ import (
"path/filepath"
"testing"
"github.com/bzz/enry/v2/data"
"github.com/go-enry/go-enry/v2/data"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data
@ -6,7 +6,7 @@ package data
import (
"regexp"
"github.com/bzz/enry/v2/data/rule"
"github.com/go-enry/go-enry/v2/data/rule"
)
var ContentHeuristics = map[string]*Heuristics{

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,6 +1,6 @@
package data
import "github.com/bzz/enry/v2/data/rule"
import "github.com/go-enry/go-enry/v2/data/rule"
// Heuristics implements a rule-based content matching engine.

View File

@ -4,7 +4,7 @@ import (
"regexp"
"testing"
"github.com/bzz/enry/v2/data/rule"
"github.com/go-enry/go-enry/v2/data/rule"
"github.com/stretchr/testify/assert"
)

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -11,6 +11,6 @@
Upstream Linguist YAML files are used to generate datastructures for data
package.
*/
package enry // import "github.com/bzz/enry/v2"
package enry // import "github.com/go-enry/go-enry/v2"
//go:generate make code-generate

8
go.mod
View File

@ -1,11 +1,11 @@
module github.com/bzz/enry/v2
module github.com/go-enry/go-enry/v2
go 1.12
go 1.14
require (
github.com/src-d/go-oniguruma v1.1.0
github.com/go-enry/go-oniguruma v1.2.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
gopkg.in/yaml.v2 v2.2.8
)

8
go.sum
View File

@ -1,9 +1,9 @@
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/go-enry/go-oniguruma v1.2.0 h1:oBO9XC1IDT9+AoWW5oFsa/7gFeOPacEqDbyXZKWXuDs=
github.com/go-enry/go-oniguruma v1.2.0/go.mod h1:bWDhYP+S6xZQgiRL7wlTScFYBe023B6ilRZbCAD5Hf4=
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.1.0 h1:EG+Nm5n2JqWUaCjtM0NtutPxU7ZN5Tp50GWrrV8bTww=
github.com/src-d/go-oniguruma v1.1.0/go.mod h1:chVbff8kcVtmrhxtZ3yBVLLquXbzCS6DrxQaAK/CeqM=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
@ -14,5 +14,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+
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=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

View File

@ -3,7 +3,7 @@ package data
import (
"regexp"
"github.com/bzz/enry/v2/data/rule"
"github.com/go-enry/go-enry/v2/data/rule"
)
var ContentHeuristics = map[string]*Heuristics{

View File

@ -1,3 +1,3 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -12,7 +12,7 @@ import (
"strconv"
"text/template"
"github.com/bzz/enry/v2/internal/tokenizer"
"github.com/go-enry/go-enry/v2/internal/tokenizer"
)
type samplesFrequencies struct {

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data
@ -6,7 +6,7 @@ package data
import (
"regexp"
"github.com/bzz/enry/v2/data/rule"
"github.com/go-enry/go-enry/v2/data/rule"
)
var ContentHeuristics = map[string]*Heuristics{

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -1,4 +1,4 @@
// Code generated by github.com/bzz/enry/v2/internal/code-generator DO NOT EDIT.
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
// Extracted from github/linguist commit: 3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d
package data

View File

@ -4,7 +4,7 @@ import (
"io/ioutil"
"log"
"github.com/bzz/enry/v2/internal/code-generator/generator"
"github.com/go-enry/go-enry/v2/internal/code-generator/generator"
)
const (

View File

@ -5,7 +5,7 @@ package tokenizer
import (
"bytes"
"github.com/bzz/enry/v2/regex"
"github.com/go-enry/go-enry/v2/regex"
)
// Tokenize returns lexical tokens from content. The tokens returned match what

View File

@ -2,7 +2,7 @@
package tokenizer
import "github.com/bzz/enry/v2/internal/tokenizer/flex"
import "github.com/go-enry/go-enry/v2/internal/tokenizer/flex"
// Tokenize returns lexical tokens from content. The tokens returned match what
// the Linguist library returns. At most the first ByteLimit bytes of content are tokenized.

View File

@ -3,7 +3,7 @@
package regex
import (
rubex "github.com/src-d/go-oniguruma"
rubex "github.com/go-enry/go-oniguruma"
)
type EnryRegexp = *rubex.Regexp

View File

@ -4,7 +4,7 @@
package main
import "C"
import "github.com/bzz/enry/v2"
import "github.com/go-enry/go-enry/v2"
//export GetLanguage
func GetLanguage(filename string, content []byte) string {

View File

@ -5,7 +5,7 @@ import (
"path/filepath"
"strings"
"github.com/bzz/enry/v2/data"
"github.com/go-enry/go-enry/v2/data"
)
const binSniffLen = 8000