mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-05-23 08:30:07 -03:00
Added utils.go generation
This commit is contained in:
parent
dae33dc2b2
commit
13e7886a02
@ -2,7 +2,7 @@ package slinguist
|
|||||||
|
|
||||||
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
||||||
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||||
// Extracted from github/linguist commit: 3a2a62baad5363a604828706f8df730902a542b0
|
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
84
internal/code-generator/assets/utils.go.tmpl
Normal file
84
internal/code-generator/assets/utils.go.tmpl
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
package slinguist
|
||||||
|
|
||||||
|
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
||||||
|
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||||
|
// Extracted from github/linguist commit: {{ getCommit }}
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"gopkg.in/toqueteos/substring.v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func IsAuxiliaryLanguage(lang string) bool {
|
||||||
|
_, ok := auxiliaryLanguages[lang]
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsConfiguration(path string) bool {
|
||||||
|
lang, _ := GetLanguageByExtension(path)
|
||||||
|
_, is := configurationLanguages[lang]
|
||||||
|
|
||||||
|
return is
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDotFile(path string) bool {
|
||||||
|
return strings.HasPrefix(filepath.Base(path), ".")
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsVendor(path string) bool {
|
||||||
|
return findIndex(path, vendorMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDocumentation(path string) bool {
|
||||||
|
return findIndex(path, documentationMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func findIndex(path string, matchers substring.StringsMatcher) int {
|
||||||
|
return matchers.MatchIndex(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
const sniffLen = 8000
|
||||||
|
|
||||||
|
//IsBinary detects if data is a binary value based on:
|
||||||
|
//http://git.kernel.org/cgit/git/git.git/tree/xdiff-interface.c?id=HEAD#n198
|
||||||
|
func IsBinary(data []byte) bool {
|
||||||
|
if len(data) > sniffLen {
|
||||||
|
data = data[:sniffLen]
|
||||||
|
}
|
||||||
|
|
||||||
|
if bytes.IndexByte(data, byte(0)) == -1 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
var vendorMatchers = substring.Or(
|
||||||
|
{{range $regexp := . -}}
|
||||||
|
substring.Regexp(`{{ $regexp }}`),
|
||||||
|
{{end -}}
|
||||||
|
)
|
||||||
|
|
||||||
|
var documentationMatchers = substring.Or(
|
||||||
|
substring.Regexp(`^docs?/`),
|
||||||
|
substring.Regexp(`(^|/)[Dd]ocumentation/`),
|
||||||
|
substring.Regexp(`(^|/)javadoc/`),
|
||||||
|
substring.Regexp(`^man/`),
|
||||||
|
substring.Regexp(`^[Ee]xamples/`),
|
||||||
|
substring.Regexp(`(^|/)CHANGE(S|LOG)?(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)CONTRIBUTING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)COPYING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)INSTALL(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)LICEN[CS]E(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Ll]icen[cs]e(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)README(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Rr]eadme(\.|$)`),
|
||||||
|
substring.Regexp(`^[Ss]amples/`),
|
||||||
|
)
|
||||||
|
|
||||||
|
var configurationLanguages = map[string]bool{
|
||||||
|
"XML": true, "JSON": true, "TOML": true, "YAML": true, "INI": true, "SQL": true,
|
||||||
|
}
|
@ -13,6 +13,7 @@ const (
|
|||||||
// FromFile test
|
// FromFile test
|
||||||
formatedLangGold = "test_files/formated_languages.gold"
|
formatedLangGold = "test_files/formated_languages.gold"
|
||||||
formatedContentGold = "test_files/formated_content.gold"
|
formatedContentGold = "test_files/formated_content.gold"
|
||||||
|
formatedUtilsGold = "test_files/formated_utils.gold"
|
||||||
|
|
||||||
// Languages test
|
// Languages test
|
||||||
ymlTestFile = "test_files/languages.test.yml"
|
ymlTestFile = "test_files/languages.test.yml"
|
||||||
@ -27,6 +28,13 @@ const (
|
|||||||
contentTestTmplPath = "test_files/content.test.go.tmpl"
|
contentTestTmplPath = "test_files/content.test.go.tmpl"
|
||||||
contentTestTmplName = "content.test.go.tmpl"
|
contentTestTmplName = "content.test.go.tmpl"
|
||||||
commitHeuristicsTest = "fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7"
|
commitHeuristicsTest = "fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7"
|
||||||
|
|
||||||
|
// Vendor test
|
||||||
|
vendorTestFile = "test_files/vendor.test.yml"
|
||||||
|
utilsGold = "test_files/utils.gold"
|
||||||
|
utilsTestTmplPath = "test_files/utils.test.go.tmpl"
|
||||||
|
utilsTestTmplName = "utils.test.go.tmpl"
|
||||||
|
commitVendorTest = "fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFromFile(t *testing.T) {
|
func TestFromFile(t *testing.T) {
|
||||||
@ -36,6 +44,9 @@ func TestFromFile(t *testing.T) {
|
|||||||
goldContent, err := ioutil.ReadFile(formatedContentGold)
|
goldContent, err := ioutil.ReadFile(formatedContentGold)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
goldUtils, err := ioutil.ReadFile(formatedUtilsGold)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
outPathLang, err := ioutil.TempFile("/tmp", "generator-test-")
|
outPathLang, err := ioutil.TempFile("/tmp", "generator-test-")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
defer os.Remove(outPathLang.Name())
|
defer os.Remove(outPathLang.Name())
|
||||||
@ -44,6 +55,10 @@ func TestFromFile(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
defer os.Remove(outPathContent.Name())
|
defer os.Remove(outPathContent.Name())
|
||||||
|
|
||||||
|
outPathUtils, err := ioutil.TempFile("/tmp", "generator-test-")
|
||||||
|
assert.NoError(t, err)
|
||||||
|
defer os.Remove(outPathContent.Name())
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
fileToParse string
|
fileToParse string
|
||||||
@ -74,6 +89,16 @@ func TestFromFile(t *testing.T) {
|
|||||||
generate: Heuristics,
|
generate: Heuristics,
|
||||||
wantOut: goldContent,
|
wantOut: goldContent,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "TestFromFile_Vendor",
|
||||||
|
fileToParse: vendorTestFile,
|
||||||
|
outPath: outPathUtils.Name(),
|
||||||
|
tmplPath: utilsTestTmplPath,
|
||||||
|
tmplName: utilsTestTmplName,
|
||||||
|
commit: commitVendorTest,
|
||||||
|
generate: Vendor,
|
||||||
|
wantOut: goldUtils,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
@ -154,3 +179,37 @@ func TestHeuristics(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestVendor(t *testing.T) {
|
||||||
|
gold, err := ioutil.ReadFile(utilsGold)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
input, err := ioutil.ReadFile(vendorTestFile)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
input []byte
|
||||||
|
tmplPath string
|
||||||
|
tmplName string
|
||||||
|
commit string
|
||||||
|
wantOut []byte
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "TestVendor",
|
||||||
|
input: input,
|
||||||
|
tmplPath: utilsTestTmplPath,
|
||||||
|
tmplName: utilsTestTmplName,
|
||||||
|
commit: commitVendorTest,
|
||||||
|
wantOut: gold,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
out, err := Vendor(tt.input, tt.tmplPath, tt.tmplName, tt.commit)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.EqualValues(t, tt.wantOut, out, fmt.Sprintf("Vendor() = %v, want %v", string(out), string(tt.wantOut)))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -0,0 +1,95 @@
|
|||||||
|
package slinguist
|
||||||
|
|
||||||
|
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
||||||
|
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||||
|
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"gopkg.in/toqueteos/substring.v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func IsAuxiliaryLanguage(lang string) bool {
|
||||||
|
_, ok := auxiliaryLanguages[lang]
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsConfiguration(path string) bool {
|
||||||
|
lang, _ := GetLanguageByExtension(path)
|
||||||
|
_, is := configurationLanguages[lang]
|
||||||
|
|
||||||
|
return is
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDotFile(path string) bool {
|
||||||
|
return strings.HasPrefix(filepath.Base(path), ".")
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsVendor(path string) bool {
|
||||||
|
return findIndex(path, vendorMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDocumentation(path string) bool {
|
||||||
|
return findIndex(path, documentationMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func findIndex(path string, matchers substring.StringsMatcher) int {
|
||||||
|
return matchers.MatchIndex(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
const sniffLen = 8000
|
||||||
|
|
||||||
|
//IsBinary detects if data is a binary value based on:
|
||||||
|
//http://git.kernel.org/cgit/git/git.git/tree/xdiff-interface.c?id=HEAD#n198
|
||||||
|
func IsBinary(data []byte) bool {
|
||||||
|
if len(data) > sniffLen {
|
||||||
|
data = data[:sniffLen]
|
||||||
|
}
|
||||||
|
|
||||||
|
if bytes.IndexByte(data, byte(0)) == -1 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
var vendorMatchers = substring.Or(
|
||||||
|
substring.Regexp(`(^|/)cache/`),
|
||||||
|
substring.Regexp(`^[Dd]ependencies/`),
|
||||||
|
substring.Regexp(`(^|/)dist/`),
|
||||||
|
substring.Regexp(`^deps/`),
|
||||||
|
substring.Regexp(`^tools/`),
|
||||||
|
substring.Regexp(`(^|/)configure$`),
|
||||||
|
substring.Regexp(`(^|/)config.guess$`),
|
||||||
|
substring.Regexp(`(^|/)config.sub$`),
|
||||||
|
substring.Regexp(`(^|/)aclocal.m4`),
|
||||||
|
substring.Regexp(`(^|/)libtool.m4`),
|
||||||
|
substring.Regexp(`(^|/)ltoptions.m4`),
|
||||||
|
substring.Regexp(`(^|/)ltsugar.m4`),
|
||||||
|
substring.Regexp(`(^|/)ltversion.m4`),
|
||||||
|
substring.Regexp(`(^|/)lt~obsolete.m4`),
|
||||||
|
)
|
||||||
|
|
||||||
|
var documentationMatchers = substring.Or(
|
||||||
|
substring.Regexp(`^docs?/`),
|
||||||
|
substring.Regexp(`(^|/)[Dd]ocumentation/`),
|
||||||
|
substring.Regexp(`(^|/)javadoc/`),
|
||||||
|
substring.Regexp(`^man/`),
|
||||||
|
substring.Regexp(`^[Ee]xamples/`),
|
||||||
|
substring.Regexp(`(^|/)CHANGE(S|LOG)?(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)CONTRIBUTING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)COPYING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)INSTALL(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)LICEN[CS]E(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Ll]icen[cs]e(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)README(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Rr]eadme(\.|$)`),
|
||||||
|
substring.Regexp(`^[Ss]amples/`),
|
||||||
|
)
|
||||||
|
|
||||||
|
var configurationLanguages = map[string]bool{
|
||||||
|
"XML": true, "JSON": true, "TOML": true, "YAML": true, "INI": true, "SQL": true,
|
||||||
|
}
|
95
internal/code-generator/generator/test_files/utils.gold
Normal file
95
internal/code-generator/generator/test_files/utils.gold
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
package slinguist
|
||||||
|
|
||||||
|
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
||||||
|
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||||
|
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"gopkg.in/toqueteos/substring.v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func IsAuxiliaryLanguage(lang string) bool {
|
||||||
|
_, ok := auxiliaryLanguages[lang]
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsConfiguration(path string) bool {
|
||||||
|
lang, _ := GetLanguageByExtension(path)
|
||||||
|
_, is := configurationLanguages[lang]
|
||||||
|
|
||||||
|
return is
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDotFile(path string) bool {
|
||||||
|
return strings.HasPrefix(filepath.Base(path), ".")
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsVendor(path string) bool {
|
||||||
|
return findIndex(path, vendorMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDocumentation(path string) bool {
|
||||||
|
return findIndex(path, documentationMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func findIndex(path string, matchers substring.StringsMatcher) int {
|
||||||
|
return matchers.MatchIndex(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
const sniffLen = 8000
|
||||||
|
|
||||||
|
//IsBinary detects if data is a binary value based on:
|
||||||
|
//http://git.kernel.org/cgit/git/git.git/tree/xdiff-interface.c?id=HEAD#n198
|
||||||
|
func IsBinary(data []byte) bool {
|
||||||
|
if len(data) > sniffLen {
|
||||||
|
data = data[:sniffLen]
|
||||||
|
}
|
||||||
|
|
||||||
|
if bytes.IndexByte(data, byte(0)) == -1 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
var vendorMatchers = substring.Or(
|
||||||
|
substring.Regexp(`(^|/)cache/`),
|
||||||
|
substring.Regexp(`^[Dd]ependencies/`),
|
||||||
|
substring.Regexp(`(^|/)dist/`),
|
||||||
|
substring.Regexp(`^deps/`),
|
||||||
|
substring.Regexp(`^tools/`),
|
||||||
|
substring.Regexp(`(^|/)configure$`),
|
||||||
|
substring.Regexp(`(^|/)config.guess$`),
|
||||||
|
substring.Regexp(`(^|/)config.sub$`),
|
||||||
|
substring.Regexp(`(^|/)aclocal.m4`),
|
||||||
|
substring.Regexp(`(^|/)libtool.m4`),
|
||||||
|
substring.Regexp(`(^|/)ltoptions.m4`),
|
||||||
|
substring.Regexp(`(^|/)ltsugar.m4`),
|
||||||
|
substring.Regexp(`(^|/)ltversion.m4`),
|
||||||
|
substring.Regexp(`(^|/)lt~obsolete.m4`),
|
||||||
|
)
|
||||||
|
|
||||||
|
var documentationMatchers = substring.Or(
|
||||||
|
substring.Regexp(`^docs?/`),
|
||||||
|
substring.Regexp(`(^|/)[Dd]ocumentation/`),
|
||||||
|
substring.Regexp(`(^|/)javadoc/`),
|
||||||
|
substring.Regexp(`^man/`),
|
||||||
|
substring.Regexp(`^[Ee]xamples/`),
|
||||||
|
substring.Regexp(`(^|/)CHANGE(S|LOG)?(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)CONTRIBUTING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)COPYING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)INSTALL(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)LICEN[CS]E(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Ll]icen[cs]e(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)README(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Rr]eadme(\.|$)`),
|
||||||
|
substring.Regexp(`^[Ss]amples/`),
|
||||||
|
)
|
||||||
|
|
||||||
|
var configurationLanguages = map[string]bool{
|
||||||
|
"XML": true, "JSON": true, "TOML": true, "YAML": true, "INI": true, "SQL": true,
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package slinguist
|
||||||
|
|
||||||
|
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
||||||
|
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||||
|
// Extracted from github/linguist commit: {{ getCommit }}
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"gopkg.in/toqueteos/substring.v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func IsAuxiliaryLanguage(lang string) bool {
|
||||||
|
_, ok := auxiliaryLanguages[lang]
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsConfiguration(path string) bool {
|
||||||
|
lang, _ := GetLanguageByExtension(path)
|
||||||
|
_, is := configurationLanguages[lang]
|
||||||
|
|
||||||
|
return is
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDotFile(path string) bool {
|
||||||
|
return strings.HasPrefix(filepath.Base(path), ".")
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsVendor(path string) bool {
|
||||||
|
return findIndex(path, vendorMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsDocumentation(path string) bool {
|
||||||
|
return findIndex(path, documentationMatchers) >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func findIndex(path string, matchers substring.StringsMatcher) int {
|
||||||
|
return matchers.MatchIndex(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
const sniffLen = 8000
|
||||||
|
|
||||||
|
//IsBinary detects if data is a binary value based on:
|
||||||
|
//http://git.kernel.org/cgit/git/git.git/tree/xdiff-interface.c?id=HEAD#n198
|
||||||
|
func IsBinary(data []byte) bool {
|
||||||
|
if len(data) > sniffLen {
|
||||||
|
data = data[:sniffLen]
|
||||||
|
}
|
||||||
|
|
||||||
|
if bytes.IndexByte(data, byte(0)) == -1 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
var vendorMatchers = substring.Or(
|
||||||
|
{{range $regexp := . -}}
|
||||||
|
substring.Regexp(`{{ $regexp }}`),
|
||||||
|
{{end -}}
|
||||||
|
)
|
||||||
|
|
||||||
|
var documentationMatchers = substring.Or(
|
||||||
|
substring.Regexp(`^docs?/`),
|
||||||
|
substring.Regexp(`(^|/)[Dd]ocumentation/`),
|
||||||
|
substring.Regexp(`(^|/)javadoc/`),
|
||||||
|
substring.Regexp(`^man/`),
|
||||||
|
substring.Regexp(`^[Ee]xamples/`),
|
||||||
|
substring.Regexp(`(^|/)CHANGE(S|LOG)?(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)CONTRIBUTING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)COPYING(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)INSTALL(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)LICEN[CS]E(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Ll]icen[cs]e(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)README(\.|$)`),
|
||||||
|
substring.Regexp(`(^|/)[Rr]eadme(\.|$)`),
|
||||||
|
substring.Regexp(`^[Ss]amples/`),
|
||||||
|
)
|
||||||
|
|
||||||
|
var configurationLanguages = map[string]bool{
|
||||||
|
"XML": true, "JSON": true, "TOML": true, "YAML": true, "INI": true, "SQL": true,
|
||||||
|
}
|
24
internal/code-generator/generator/test_files/vendor.test.yml
Normal file
24
internal/code-generator/generator/test_files/vendor.test.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Caches
|
||||||
|
- (^|/)cache/
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
- ^[Dd]ependencies/
|
||||||
|
|
||||||
|
# Distributions
|
||||||
|
- (^|/)dist/
|
||||||
|
|
||||||
|
# C deps
|
||||||
|
# https://github.com/joyent/node
|
||||||
|
- ^deps/
|
||||||
|
- ^tools/
|
||||||
|
- (^|/)configure$
|
||||||
|
- (^|/)config.guess$
|
||||||
|
- (^|/)config.sub$
|
||||||
|
|
||||||
|
# stuff autogenerated by autoconf - still C deps
|
||||||
|
- (^|/)aclocal.m4
|
||||||
|
- (^|/)libtool.m4
|
||||||
|
- (^|/)ltoptions.m4
|
||||||
|
- (^|/)ltsugar.m4
|
||||||
|
- (^|/)ltversion.m4
|
||||||
|
- (^|/)lt~obsolete.m4
|
37
internal/code-generator/generator/vendor.go
Normal file
37
internal/code-generator/generator/vendor.go
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package generator
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"html/template"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
yaml "gopkg.in/yaml.v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Vendor reads from buf and builds utils.go file from utilsTmplPath.
|
||||||
|
func Vendor(data []byte, uitlsTmplPath, utilsTmplName, commit string) ([]byte, error) {
|
||||||
|
var regexpList []string
|
||||||
|
if err := yaml.Unmarshal(data, ®expList); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
buf := &bytes.Buffer{}
|
||||||
|
if err := executeUtilsTemplate(buf, regexpList, uitlsTmplPath, utilsTmplName, commit); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func executeUtilsTemplate(out io.Writer, regexpList []string, languagesTmplPath, languagesTmpl, commit string) error {
|
||||||
|
fmap := template.FuncMap{
|
||||||
|
"getCommit": func() string { return commit },
|
||||||
|
}
|
||||||
|
|
||||||
|
t := template.Must(template.New(languagesTmpl).Funcs(fmap).ParseFiles(languagesTmplPath))
|
||||||
|
if err := t.Execute(out, regexpList); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
@ -18,6 +18,11 @@ const (
|
|||||||
contentTmplPath = "internal/code-generator/assets/content.go.tmpl"
|
contentTmplPath = "internal/code-generator/assets/content.go.tmpl"
|
||||||
contentTmpl = "content.go.tmpl"
|
contentTmpl = "content.go.tmpl"
|
||||||
|
|
||||||
|
vendorYAML = ".linguist/lib/linguist/vendor.yml"
|
||||||
|
utilsFile = "utils.go"
|
||||||
|
utilsTmplPath = "internal/code-generator/assets/utils.go.tmpl"
|
||||||
|
utilsTmpl = "utils.go.tmpl"
|
||||||
|
|
||||||
commitPath = ".git/refs/heads/master"
|
commitPath = ".git/refs/heads/master"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -34,6 +39,14 @@ func main() {
|
|||||||
if err := generator.FromFile(heuristicsRuby, contentFile, contentTmplPath, contentTmpl, commit, generator.Heuristics); err != nil {
|
if err := generator.FromFile(heuristicsRuby, contentFile, contentTmplPath, contentTmpl, commit, generator.Heuristics); err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := generator.FromFile(vendorYAML, utilsFile, utilsTmplPath, utilsTmpl, commit, generator.Vendor); err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := generator.FromFile(vendorYAML, utilsFile, utilsTmplPath, utilsTmpl, commit, generator.Vendor); err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCommit(path string) (string, error) {
|
func getCommit(path string) (string, error) {
|
||||||
|
@ -2,7 +2,7 @@ package slinguist
|
|||||||
|
|
||||||
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
||||||
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||||
// Extracted from github/linguist commit: 3a2a62baad5363a604828706f8df730902a542b0
|
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9
|
||||||
|
|
||||||
var languagesByExtension = map[string][]string{
|
var languagesByExtension = map[string][]string{
|
||||||
".1": {"Roff"},
|
".1": {"Roff"},
|
||||||
|
363
utils.go
363
utils.go
@ -1,5 +1,9 @@
|
|||||||
package slinguist
|
package slinguist
|
||||||
|
|
||||||
|
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
|
||||||
|
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||||
|
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -52,220 +56,153 @@ func IsBinary(data []byte) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// From github/linguist.
|
|
||||||
// curl https://raw.githubusercontent.com/github/linguist/master/lib/linguist/vendor.yml | python -c 'import sys, yaml; l = yaml.load(sys.stdin.read()); print "var skipped = []*regexp.Regexp{\n" + "\n".join(["\tregexp.MustCompile(`" + i + "`)," for i in l]) + "\n}"'
|
|
||||||
|
|
||||||
var vendorMatchers = substring.Or(
|
var vendorMatchers = substring.Or(
|
||||||
substring.Suffix(`.framer`),
|
substring.Regexp(`(^|/)cache/`),
|
||||||
substring.SuffixGroup(`.js`,
|
substring.Regexp(`^[Dd]ependencies/`),
|
||||||
substring.After(`cordova-`, substring.Regexp(`\d\.\d(\.\d)?`)),
|
substring.Regexp(`(^|/)dist/`),
|
||||||
substring.After(`d3`, substring.Regexp(`(\.v\d+)?([^.]*)`)),
|
substring.Regexp(`^deps/`),
|
||||||
substring.After(`jquery-`, substring.Regexp(`\d\.\d+(\.\d+)?`)),
|
substring.Regexp(`^tools/`),
|
||||||
substring.After(`jquery-ui`, substring.Regexp(`(\-\d\.\d+(\.\d+)?)?(\.\w+)?`)),
|
substring.Regexp(`(^|/)configure$`),
|
||||||
substring.After(`knockout-`, substring.Regexp(`(\d+\.){3}(debug\.)?$`)),
|
substring.Regexp(`(^|/)config.guess$`),
|
||||||
substring.After(`microsoft`, substring.Regexp(`([Mm]vc)?([Aa]jax|[Vv]alidation)(\.debug)?`)),
|
substring.Regexp(`(^|/)config.sub$`),
|
||||||
substring.After(`Microsoft`, substring.Regexp(`([Mm]vc)?([Aa]jax|[Vv]alidation)(\.debug)?`)),
|
substring.Regexp(`(^|/)aclocal.m4`),
|
||||||
substring.After(`modernizr-`, substring.Regexp(`\d\.\d+(\.\d+)?`)),
|
substring.Regexp(`(^|/)libtool.m4`),
|
||||||
substring.After(`mootools`, substring.Regexp(`([^.]*)\d+\.\d+.\d+([^.]*)`)),
|
substring.Regexp(`(^|/)ltoptions.m4`),
|
||||||
substring.Has(`angular`),
|
substring.Regexp(`(^|/)ltsugar.m4`),
|
||||||
substring.Has(`bootstrap`),
|
substring.Regexp(`(^|/)ltversion.m4`),
|
||||||
substring.Has(`cordova`),
|
substring.Regexp(`(^|/)lt~obsolete.m4`),
|
||||||
substring.Has(`less`),
|
substring.Regexp(`cpplint.py`),
|
||||||
substring.Has(`custom.bootstrap`),
|
substring.Regexp(`node_modules/`),
|
||||||
substring.Has(`extjs/`),
|
substring.Regexp(`bower_components/`),
|
||||||
substring.Has(`foundation`),
|
substring.Regexp(`^rebar$`),
|
||||||
substring.Has(`jquery.effects.`),
|
substring.Regexp(`erlang.mk`),
|
||||||
substring.Has(`jquery.ui.`),
|
substring.Regexp(`Godeps/_workspace/`),
|
||||||
substring.Has(`jquery`),
|
substring.Regexp(`.indent.pro`),
|
||||||
substring.Has(`modernizr.custom.`),
|
substring.Regexp(`(\.|-)min\.(js|css)$`),
|
||||||
substring.Has(`prototype`),
|
substring.Regexp(`([^\s]*)import\.(css|less|scss|styl)$`),
|
||||||
substring.Has(`backbone`),
|
substring.Regexp(`(^|/)bootstrap([^.]*)\.(js|css|less|scss|styl)$`),
|
||||||
substring.Has(`three`),
|
substring.Regexp(`(^|/)custom\.bootstrap([^\s]*)(js|css|less|scss|styl)$`),
|
||||||
substring.Has(`ember`),
|
substring.Regexp(`(^|/)font-awesome\.(css|less|scss|styl)$`),
|
||||||
substring.Has(`babylon`),
|
substring.Regexp(`(^|/)foundation\.(css|less|scss|styl)$`),
|
||||||
substring.Has(`react`),
|
substring.Regexp(`(^|/)normalize\.(css|less|scss|styl)$`),
|
||||||
substring.Has(`shBrush`),
|
substring.Regexp(`(^|/)[Bb]ourbon/.*\.(css|less|scss|styl)$`),
|
||||||
substring.Has(`tiny_mce`),
|
substring.Regexp(`(^|/)animate\.(css|less|scss|styl)$`),
|
||||||
substring.Has(`yahoo-`),
|
substring.Regexp(`third[-_]?party/`),
|
||||||
substring.Has(`html5-`),
|
substring.Regexp(`3rd[-_]?party/`),
|
||||||
substring.Has(`yui`),
|
substring.Regexp(`vendors?/`),
|
||||||
substring.Has(`underscore`),
|
substring.Regexp(`extern(al)?/`),
|
||||||
substring.Has(`lodash`),
|
substring.Regexp(`(^|/)[Vv]+endor/`),
|
||||||
substring.Has(`lodash.core`),
|
substring.Regexp(`^debian/`),
|
||||||
substring.Has(`coffee-script`),
|
substring.Regexp(`run.n$`),
|
||||||
substring.Suffixes(
|
substring.Regexp(`bootstrap-datepicker/`),
|
||||||
`-vsdoc.js`,
|
substring.Regexp(`(^|/)jquery([^.]*)\.js$`),
|
||||||
`.intellisense.js`,
|
substring.Regexp(`(^|/)jquery\-\d\.\d+(\.\d+)?\.js$`),
|
||||||
`Chart.js`,
|
substring.Regexp(`(^|/)jquery\-ui(\-\d\.\d+(\.\d+)?)?(\.\w+)?\.(js|css)$`),
|
||||||
`ckeditor.js`,
|
substring.Regexp(`(^|/)jquery\.(ui|effects)\.([^.]*)\.(js|css)$`),
|
||||||
`controls.js`,
|
substring.Regexp(`jquery.fn.gantt.js`),
|
||||||
`dojo.js`,
|
substring.Regexp(`jquery.fancybox.(js|css)`),
|
||||||
`dragdrop.js`,
|
substring.Regexp(`fuelux.js`),
|
||||||
`effects.js`,
|
substring.Regexp(`(^|/)jquery\.fileupload(-\w+)?\.js$`),
|
||||||
`html5shiv.js`,
|
substring.Regexp(`(^|/)slick\.\w+.js$`),
|
||||||
`MochiKit.js`,
|
substring.Regexp(`(^|/)Leaflet\.Coordinates-\d+\.\d+\.\d+\.src\.js$`),
|
||||||
`shCore.js`,
|
substring.Regexp(`leaflet.draw-src.js`),
|
||||||
`shLegacy.js`,
|
substring.Regexp(`leaflet.draw.css`),
|
||||||
`.min.js`,
|
substring.Regexp(`Control.FullScreen.css`),
|
||||||
`-min.js`,
|
substring.Regexp(`Control.FullScreen.js`),
|
||||||
),
|
substring.Regexp(`leaflet.spin.js`),
|
||||||
),
|
substring.Regexp(`wicket-leaflet.js`),
|
||||||
substring.SuffixGroup(`.css`,
|
substring.Regexp(`.sublime-project`),
|
||||||
substring.Has(`bootstrap`),
|
substring.Regexp(`.sublime-workspace`),
|
||||||
substring.Has(`custom.bootstrap`),
|
substring.Regexp(`(^|/)prototype(.*)\.js$`),
|
||||||
substring.Has(`jquery.effects.`),
|
substring.Regexp(`(^|/)effects\.js$`),
|
||||||
substring.Has(`jquery.ui.`),
|
substring.Regexp(`(^|/)controls\.js$`),
|
||||||
substring.Has(`octicons.css`),
|
substring.Regexp(`(^|/)dragdrop\.js$`),
|
||||||
substring.After(`jquery-ui`, substring.Regexp(`(\-\d\.\d+(\.\d+)?)?(\.\w+)?`)),
|
substring.Regexp(`(.*?)\.d\.ts$`),
|
||||||
substring.Suffixes(
|
substring.Regexp(`(^|/)mootools([^.]*)\d+\.\d+.\d+([^.]*)\.js$`),
|
||||||
`animate.css`,
|
substring.Regexp(`(^|/)dojo\.js$`),
|
||||||
`bourbon.css`,
|
substring.Regexp(`(^|/)MochiKit\.js$`),
|
||||||
`Bourbon.css`,
|
substring.Regexp(`(^|/)yahoo-([^.]*)\.js$`),
|
||||||
`font-awesome.css`,
|
substring.Regexp(`(^|/)yui([^.]*)\.js$`),
|
||||||
`foundation.css`,
|
substring.Regexp(`(^|/)ckeditor\.js$`),
|
||||||
`import.css`,
|
substring.Regexp(`(^|/)tiny_mce([^.]*)\.js$`),
|
||||||
`normalize.css`,
|
substring.Regexp(`(^|/)tiny_mce/(langs|plugins|themes|utils)`),
|
||||||
`.min.css`,
|
substring.Regexp(`(^|/)ace-builds/`),
|
||||||
`-min.css`,
|
substring.Regexp(`(^|/)fontello(.*?)\.css$`),
|
||||||
),
|
substring.Regexp(`(^|/)MathJax/`),
|
||||||
),
|
substring.Regexp(`(^|/)Chart\.js$`),
|
||||||
substring.SuffixGroup(`.scss`,
|
substring.Regexp(`(^|/)[Cc]ode[Mm]irror/(\d+\.\d+/)?(lib|mode|theme|addon|keymap|demo)`),
|
||||||
substring.Has(`bootstrap`),
|
substring.Regexp(`(^|/)shBrush([^.]*)\.js$`),
|
||||||
substring.Has(`custom.bootstrap`),
|
substring.Regexp(`(^|/)shCore\.js$`),
|
||||||
substring.Has(`sprockets-octicons.scss`),
|
substring.Regexp(`(^|/)shLegacy\.js$`),
|
||||||
substring.Suffixes(
|
substring.Regexp(`(^|/)angular([^.]*)\.js$`),
|
||||||
`animate.scss`,
|
substring.Regexp(`(^|\/)d3(\.v\d+)?([^.]*)\.js$`),
|
||||||
`bourbon.scss`,
|
substring.Regexp(`(^|/)react(-[^.]*)?\.js$`),
|
||||||
`Bourbon.scss`,
|
substring.Regexp(`(^|/)modernizr\-\d\.\d+(\.\d+)?\.js$`),
|
||||||
`font-awesome.scss`,
|
substring.Regexp(`(^|/)modernizr\.custom\.\d+\.js$`),
|
||||||
`foundation.scss`,
|
substring.Regexp(`(^|/)knockout-(\d+\.){3}(debug\.)?js$`),
|
||||||
`import.scss`,
|
substring.Regexp(`(^|/)docs?/_?(build|themes?|templates?|static)/`),
|
||||||
`normalize.scss`,
|
substring.Regexp(`(^|/)admin_media/`),
|
||||||
),
|
substring.Regexp(`(^|/)env/`),
|
||||||
),
|
substring.Regexp(`^fabfile\.py$`),
|
||||||
substring.SuffixGroup(`.less`,
|
substring.Regexp(`^waf$`),
|
||||||
substring.Has(`bootstrap`),
|
substring.Regexp(`^.osx$`),
|
||||||
substring.Has(`custom.bootstrap`),
|
substring.Regexp(`\.xctemplate/`),
|
||||||
substring.Suffixes(
|
substring.Regexp(`\.imageset/`),
|
||||||
`animate.less`,
|
substring.Regexp(`^Carthage/`),
|
||||||
`bourbon.less`,
|
substring.Regexp(`^Pods/`),
|
||||||
`Bourbon.less`,
|
substring.Regexp(`(^|/)Sparkle/`),
|
||||||
`font-awesome.less`,
|
substring.Regexp(`Crashlytics.framework/`),
|
||||||
`foundation.less`,
|
substring.Regexp(`Fabric.framework/`),
|
||||||
`import.less`,
|
substring.Regexp(`BuddyBuildSDK.framework/`),
|
||||||
`normalize.less`,
|
substring.Regexp(`Realm.framework`),
|
||||||
),
|
substring.Regexp(`RealmSwift.framework`),
|
||||||
),
|
substring.Regexp(`gitattributes$`),
|
||||||
substring.SuffixGroup(`.styl`,
|
substring.Regexp(`gitignore$`),
|
||||||
substring.Has(`bootstrap`),
|
substring.Regexp(`gitmodules$`),
|
||||||
substring.Has(`custom.bootstrap`),
|
substring.Regexp(`(^|/)gradlew$`),
|
||||||
substring.Suffixes(
|
substring.Regexp(`(^|/)gradlew\.bat$`),
|
||||||
`animate.styl`,
|
substring.Regexp(`(^|/)gradle/wrapper/`),
|
||||||
`bourbon.styl`,
|
substring.Regexp(`-vsdoc\.js$`),
|
||||||
`Bourbon.styl`,
|
substring.Regexp(`\.intellisense\.js$`),
|
||||||
`font-awesome.styl`,
|
substring.Regexp(`(^|/)jquery([^.]*)\.validate(\.unobtrusive)?\.js$`),
|
||||||
`foundation.styl`,
|
substring.Regexp(`(^|/)jquery([^.]*)\.unobtrusive\-ajax\.js$`),
|
||||||
`import.styl`,
|
substring.Regexp(`(^|/)[Mm]icrosoft([Mm]vc)?([Aa]jax|[Vv]alidation)(\.debug)?\.js$`),
|
||||||
`normalize.styl`,
|
substring.Regexp(`^[Pp]ackages\/.+\.\d+\/`),
|
||||||
),
|
substring.Regexp(`(^|/)extjs/.*?\.js$`),
|
||||||
),
|
substring.Regexp(`(^|/)extjs/.*?\.xml$`),
|
||||||
substring.After(`codemirror/`, substring.Or(
|
substring.Regexp(`(^|/)extjs/.*?\.txt$`),
|
||||||
substring.Exact(`lib`),
|
substring.Regexp(`(^|/)extjs/.*?\.html$`),
|
||||||
substring.Exact(`mode`),
|
substring.Regexp(`(^|/)extjs/.*?\.properties$`),
|
||||||
substring.Exact(`theme`),
|
substring.Regexp(`(^|/)extjs/.sencha/`),
|
||||||
substring.Exact(`addon`),
|
substring.Regexp(`(^|/)extjs/docs/`),
|
||||||
substring.Exact(`keymap`),
|
substring.Regexp(`(^|/)extjs/builds/`),
|
||||||
)),
|
substring.Regexp(`(^|/)extjs/cmd/`),
|
||||||
substring.After(`extjs/`, substring.Or(
|
substring.Regexp(`(^|/)extjs/examples/`),
|
||||||
substring.Suffixes(`.html`, `.properties`, `.txt`, `.xml`),
|
substring.Regexp(`(^|/)extjs/locale/`),
|
||||||
substring.Exact(`.sencha/`),
|
substring.Regexp(`(^|/)extjs/packages/`),
|
||||||
substring.Exact(`builds/`),
|
substring.Regexp(`(^|/)extjs/plugins/`),
|
||||||
substring.Exact(`cmd/`),
|
substring.Regexp(`(^|/)extjs/resources/`),
|
||||||
substring.Exact(`docs/`),
|
substring.Regexp(`(^|/)extjs/src/`),
|
||||||
substring.Exact(`examples/`),
|
substring.Regexp(`(^|/)extjs/welcome/`),
|
||||||
substring.Exact(`locale/`),
|
substring.Regexp(`(^|/)html5shiv\.js$`),
|
||||||
substring.Exact(`packages/`),
|
substring.Regexp(`^[Tt]ests?/fixtures/`),
|
||||||
substring.Exact(`plugins/`),
|
substring.Regexp(`^[Ss]pecs?/fixtures/`),
|
||||||
substring.Exact(`resources/`),
|
substring.Regexp(`(^|/)cordova([^.]*)\.js$`),
|
||||||
substring.Exact(`src/`),
|
substring.Regexp(`(^|/)cordova\-\d\.\d(\.\d)?\.js$`),
|
||||||
substring.Exact(`welcome/`),
|
substring.Regexp(`foundation(\..*)?\.js$`),
|
||||||
)),
|
substring.Regexp(`^Vagrantfile$`),
|
||||||
substring.After(`tiny_mce/`, substring.Or(
|
substring.Regexp(`.[Dd][Ss]_[Ss]tore$`),
|
||||||
substring.Exact(`langs`),
|
substring.Regexp(`^vignettes/`),
|
||||||
substring.Exact(`plugins`),
|
substring.Regexp(`^inst/extdata/`),
|
||||||
substring.Exact(`themes`),
|
substring.Regexp(`octicons.css`),
|
||||||
substring.Exact(`utils`),
|
substring.Regexp(`sprockets-octicons.scss`),
|
||||||
)),
|
substring.Regexp(`(^|/)activator$`),
|
||||||
substring.Has(`3rd-party/`),
|
substring.Regexp(`(^|/)activator\.bat$`),
|
||||||
substring.Has(`3rd_party/`),
|
substring.Regexp(`proguard.pro`),
|
||||||
substring.Has(`3rdparty/`),
|
substring.Regexp(`proguard-rules.pro`),
|
||||||
substring.Has(`admin_media/`),
|
substring.Regexp(`^puphpet/`),
|
||||||
substring.Has(`bower_components/`),
|
substring.Regexp(`(^|/)\.google_apis/`),
|
||||||
substring.Has(`cache/`),
|
substring.Regexp(`^Jenkinsfile$`),
|
||||||
substring.Has(`Dependencies/`),
|
|
||||||
substring.Has(`dependencies/`),
|
|
||||||
substring.Has(`erlang.mk`),
|
|
||||||
substring.Has(`extern/`),
|
|
||||||
substring.Has(`external/`),
|
|
||||||
substring.Has(`Godeps/_workspace/`),
|
|
||||||
substring.Has(`gradle/wrapper/`),
|
|
||||||
substring.Has(`MathJax/`),
|
|
||||||
substring.Has(`node_modules/`),
|
|
||||||
substring.Has(`proguard-rules.pro`),
|
|
||||||
substring.Has(`proguard.pro`),
|
|
||||||
substring.Has(`Sparkle/`),
|
|
||||||
substring.Has(`third-party/`),
|
|
||||||
substring.Has(`third_party/`),
|
|
||||||
substring.Has(`thirdparty/`),
|
|
||||||
substring.Has(`vendor/`),
|
|
||||||
substring.Has(`vendors/`),
|
|
||||||
substring.Exact(`.osx`),
|
|
||||||
substring.Exact(`rebar`),
|
|
||||||
substring.Exact(`Vagrantfile`),
|
|
||||||
substring.Exact(`waf`),
|
|
||||||
substring.Prefixes(
|
|
||||||
`.google_apis/`,
|
|
||||||
`debian/`,
|
|
||||||
`deps/`,
|
|
||||||
`inst/extdata/`,
|
|
||||||
`packages/`,
|
|
||||||
`Packages/`,
|
|
||||||
`Pods/`,
|
|
||||||
`Samples/`,
|
|
||||||
`samples/`,
|
|
||||||
`Test/fixture/`,
|
|
||||||
`test/fixture/`,
|
|
||||||
`Test/fixtures/`,
|
|
||||||
`test/fixtures/`,
|
|
||||||
`tools/`,
|
|
||||||
`vignettes/`,
|
|
||||||
),
|
|
||||||
substring.Suffixes(
|
|
||||||
`.d.ts`,
|
|
||||||
`.travis.yml`,
|
|
||||||
`activator.bat`,
|
|
||||||
`activator`,
|
|
||||||
`circle.yml`,
|
|
||||||
`config.guess`,
|
|
||||||
`config.sub`,
|
|
||||||
`configure.ac`,
|
|
||||||
`configure`,
|
|
||||||
`fabfile.py`,
|
|
||||||
`gitattributes`,
|
|
||||||
`gitignore`,
|
|
||||||
`gitmodules`,
|
|
||||||
`gradlew.bat`,
|
|
||||||
`gradlew`,
|
|
||||||
`run.n`,
|
|
||||||
`.DS_Store`,
|
|
||||||
`.DS_store`,
|
|
||||||
`.dS_Store`,
|
|
||||||
`.dS_store`,
|
|
||||||
`.Ds_Store`,
|
|
||||||
`.Ds_store`,
|
|
||||||
`.ds_Store`,
|
|
||||||
`.ds_store`,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var documentationMatchers = substring.Or(
|
var documentationMatchers = substring.Or(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user