Merge branch 'master' into spelling

This commit is contained in:
Alex
2022-12-03 10:48:23 +01:00
committed by GitHub
44 changed files with 18303 additions and 10643 deletions

View File

@ -4,12 +4,12 @@ jobs:
test: test:
strategy: strategy:
matrix: matrix:
go-version: [1.16.x, 1.17.x] go-version: [1.18.x, 1.19.x]
platform: [ubuntu-latest, macos-latest, windows-latest] platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
steps: steps:
- name: Install Go - name: Install Go
uses: actions/setup-go@v1 uses: actions/setup-go@v3
with: with:
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}
- name: Set git on win to use LF - name: Set git on win to use LF
@ -26,7 +26,7 @@ jobs:
test-oniguruma: test-oniguruma:
strategy: strategy:
matrix: matrix:
go-version: [1.16.x, 1.17.x] go-version: [1.18.x, 1.19.x]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
ONIGURUMA_VERSION: 6.9.4 ONIGURUMA_VERSION: 6.9.4
@ -39,7 +39,7 @@ jobs:
sudo dpkg -i "libonig-dev_${ONIGURUMA_VERSION}-1_amd64.deb" sudo dpkg -i "libonig-dev_${ONIGURUMA_VERSION}-1_amd64.deb"
- name: Install Go - name: Install Go
uses: actions/setup-go@v1 uses: actions/setup-go@v3
with: with:
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}

View File

@ -4,7 +4,7 @@ jobs:
test: test:
strategy: strategy:
matrix: matrix:
python-version: [3.6, 3.7, 3.8] python-version: [3.7, 3.8, 3.9]
platform: [ubuntu-latest, macos-latest] platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
steps: steps:

View File

@ -61,7 +61,7 @@ To make a guess only based on the content of the file or a text snippet, use
### By file ### By file
The most accurate guess would be one when both, the file name and the content are available: The most accurate guess would be when both, a file name and it's content are available:
- `GetLanguagesByContent` only uses file extension and a set of regexp-based content heuristics. - `GetLanguagesByContent` only uses file extension and a set of regexp-based content heuristics.
- `GetLanguages` uses the full set of matching strategies and is expected to be most accurate. - `GetLanguages` uses the full set of matching strategies and is expected to be most accurate.
@ -156,7 +156,7 @@ Generated Rust bindings using a C static library are available at https://github
## Divergences from Linguist ## Divergences from Linguist
The `enry` library is based on the data from `github/linguist` version **v7.20.0**. The `enry` library is based on the data from `github/linguist` version **v7.21.0**.
Parsing [linguist/samples](https://github.com/github/linguist/tree/master/samples) the following `enry` results are different from the Linguist: Parsing [linguist/samples](https://github.com/github/linguist/tree/master/samples) the following `enry` results are different from the Linguist:
@ -212,8 +212,8 @@ To run the tests use:
go test ./... go test ./...
Setting `ENRY_TEST_REPO` to the path to existing checkout of Linguist will avoid cloning it and sepeed tests up. Setting `ENRY_TEST_REPO` to a path to the existing checkout of the Linguist will avoid cloning it and speeds tests up.
Setting `ENRY_DEBUG=1` will provide insight in the Bayesian classifier building done by `make code-generate`. Setting `ENRY_DEBUG=1` will provide insight into the Bayesian classifier built during `make code-generate`.
### Sync with github/linguist upstream ### Sync with github/linguist upstream
@ -237,12 +237,12 @@ To stay in sync, enry needs to be updated when a new release of the linguist inc
- [vendor.yml](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml) - [vendor.yml](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml)
- [documentation.yml](https://github.com/github/linguist/blob/master/lib/linguist/documentation.yml) - [documentation.yml](https://github.com/github/linguist/blob/master/lib/linguist/documentation.yml)
There is no automation for detecting the changes in the linguist project, so this process above has to be done manually from time to time. There now is automation for detecting the changes in the upstream Linguist project: every day Github CI runs [a job](.github/workflows/sync-linguist.yml) that will create a PR to this repo for each new Linguist release. It will include all the steps from the above.
When submitting a pull request syncing up to a new release, please make sure it only contains the changes in When submitting a pull request syncing up to a new release manually, please make sure it only contains the changes in
the generated files (in [data](https://github.com/go-enry/go-enry/blob/master/data) subdirectory). the generated files (in [data](https://github.com/go-enry/go-enry/blob/master/data) subdirectory).
Separating all the necessary "manual" code changes to a different PR that includes some background description and an update to the documentation on ["divergences from linguist"](#divergences-from-linguist) is very much appreciated as it simplifies the maintenance (review/release notes/etc). Separating all the necessary "manual" code changes to a different PR that includes some background description and an update to the documentation on ["divergences from linguist"](#divergences-from-linguist) is encouraged and very much appreciated, as it simplifies the maintenance (review/release notes/etc).
## Misc ## Misc

View File

@ -6,11 +6,8 @@ import (
"io/ioutil" "io/ioutil"
"log" "log"
"os" "os"
"os/exec"
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/go-enry/go-enry/v2/data"
) )
type sample struct { type sample struct {
@ -23,22 +20,21 @@ var (
overcomeLanguage string overcomeLanguage string
overcomeLanguages []string overcomeLanguages []string
samples []*sample samples []*sample
samplesDir string
cloned bool
) )
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
flag.BoolVar(&slow, "slow", false, "run benchmarks per sample for strategies too") flag.BoolVar(&slow, "slow", false, "run benchmarks per sample for strategies too")
flag.Parse() flag.Parse()
if err := cloneLinguist(linguistURL); err != nil { tmpLinguistDir, cleanupNeeded, err := maybeCloneLinguist()
if err != nil {
log.Fatal(err) log.Fatal(err)
} }
if cloned { if cleanupNeeded {
defer os.RemoveAll(filepath.Dir(samplesDir)) defer os.RemoveAll(tmpLinguistDir)
} }
var err error samplesDir := filepath.Join(tmpLinguistDir, "samples")
samples, err = getSamples(samplesDir) samples, err = getSamples(samplesDir)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -47,47 +43,6 @@ func TestMain(m *testing.M) {
os.Exit(m.Run()) os.Exit(m.Run())
} }
func cloneLinguist(linguistURL string) error {
repoLinguist := os.Getenv(linguistClonedEnvVar)
cloned = repoLinguist == ""
if cloned {
var err error
repoLinguist, err = ioutil.TempDir("", "linguist-")
if err != nil {
return err
}
}
samplesDir = filepath.Join(repoLinguist, "samples")
if cloned {
cmd := exec.Command("git", "clone", linguistURL, repoLinguist)
if err := cmd.Run(); err != nil {
return err
}
}
cwd, err := os.Getwd()
if err != nil {
return err
}
if err = os.Chdir(repoLinguist); err != nil {
return err
}
cmd := exec.Command("git", "checkout", data.LinguistCommit)
if err := cmd.Run(); err != nil {
return err
}
if err = os.Chdir(cwd); err != nil {
return err
}
return nil
}
func getSamples(dir string) ([]*sample, error) { func getSamples(dir string) ([]*sample, error) {
samples := make([]*sample, 0, 2000) samples := make([]*sample, 0, 2000)
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {

View File

@ -38,7 +38,7 @@ var defaultClassifier classifier = &naiveBayes{
} }
// GetLanguage applies a sequence of strategies based on the given filename and content // GetLanguage applies a sequence of strategies based on the given filename and content
// to find out the most probably language to return. // to find out the most probable language to return.
func GetLanguage(filename string, content []byte) (language string) { func GetLanguage(filename string, content []byte) (language string) {
languages := GetLanguages(filename, content) languages := GetLanguages(filename, content)
return firstLanguage(languages) return firstLanguage(languages)
@ -508,28 +508,6 @@ func GetLanguageExtensions(language string) []string {
return data.ExtensionsByLanguage[language] return data.ExtensionsByLanguage[language]
} }
// GetLanguageID returns the ID for the language. IDs are assigned by GitHub.
// The input must be the canonical language name. Aliases are not supported.
//
// NOTE: The zero value (0) is a valid language ID, so this API mimics the Go
// map API. Use the second return value to check if the language was found.
func GetLanguageID(language string) (int, bool) {
id, ok := data.IDByLanguage[language]
return id, ok
}
// Type represent language's type. Either data, programming, markup, prose, or unknown.
type Type int
// Type's values.
const (
Unknown Type = Type(data.TypeUnknown)
Data = Type(data.TypeData)
Programming = Type(data.TypeProgramming)
Markup = Type(data.TypeMarkup)
Prose = Type(data.TypeProse)
)
// GetLanguageType returns the type of the given language. // GetLanguageType returns the type of the given language.
func GetLanguageType(language string) (langType Type) { func GetLanguageType(language string) (langType Type) {
intType, ok := data.LanguagesType[language] intType, ok := data.LanguagesType[language]
@ -540,6 +518,15 @@ func GetLanguageType(language string) (langType Type) {
return langType return langType
} }
// GetLanguageGroup returns language group or empty string if language does not have group.
func GetLanguageGroup(language string) string {
if group, ok := data.LanguagesGroup[language]; ok {
return group
}
return ""
}
// GetLanguageByAlias returns either the language related to the given alias and ok set to true // GetLanguageByAlias returns either the language related to the given alias and ok set to true
// or Otherlanguage and ok set to false if the alias is not recognized. // or Otherlanguage and ok set to false if the alias is not recognized.
func GetLanguageByAlias(alias string) (lang string, ok bool) { func GetLanguageByAlias(alias string) (lang string, ok bool) {
@ -551,13 +538,14 @@ func GetLanguageByAlias(alias string) (lang string, ok bool) {
return return
} }
// GetLanguageGroup returns language group or empty string if language does not have group. // GetLanguageID returns the ID for the language. IDs are assigned by GitHub.
func GetLanguageGroup(language string) string { // The input must be the canonical language name. Aliases are not supported.
if group, ok := data.LanguagesGroup[language]; ok { //
return group // NOTE: The zero value (0) is a valid language ID, so this API mimics the Go
} // map API. Use the second return value to check if the language was found.
func GetLanguageID(language string) (int, bool) {
return "" id, ok := data.IDByLanguage[language]
return id, ok
} }
// GetLanguageInfo returns the LanguageInfo for a given language name, or an error if not found. // GetLanguageInfo returns the LanguageInfo for a given language name, or an error if not found.

View File

@ -19,15 +19,78 @@ import (
const linguistURL = "https://github.com/github/linguist.git" const linguistURL = "https://github.com/github/linguist.git"
const linguistClonedEnvVar = "ENRY_TEST_REPO" const linguistClonedEnvVar = "ENRY_TEST_REPO"
type EnryTestSuite struct { // not a part of the test Suite as benchmark does not use testify
func maybeCloneLinguist() (string, bool, error) {
var err error
linguistTmpDir := os.Getenv(linguistClonedEnvVar)
isCleanupNeeded := false
isLinguistCloned := linguistTmpDir != ""
if !isLinguistCloned {
linguistTmpDir, err = ioutil.TempDir("", "linguist-")
if err != nil {
return "", false, err
}
isCleanupNeeded = true
cmd := exec.Command("git", "clone", "--depth", "100", linguistURL, linguistTmpDir)
if err := cmd.Run(); err != nil {
return linguistTmpDir, isCleanupNeeded, err
}
}
cwd, err := os.Getwd()
if err != nil {
return linguistTmpDir, isCleanupNeeded, err
}
if err = os.Chdir(linguistTmpDir); err != nil {
return linguistTmpDir, isCleanupNeeded, err
}
cmd := exec.Command("git", "checkout", data.LinguistCommit)
if err := cmd.Run(); err != nil {
return linguistTmpDir, isCleanupNeeded, err
}
if err = os.Chdir(cwd); err != nil {
return linguistTmpDir, isCleanupNeeded, err
}
return linguistTmpDir, isCleanupNeeded, nil
}
type enryBaseTestSuite struct {
suite.Suite suite.Suite
tmpLinguist string tmpLinguistDir string
needToClone bool isCleanupNeeded bool
samplesDir string samplesDir string
testFixturesDir string testFixturesDir string
} }
func (s *EnryTestSuite) TestRegexpEdgeCases() { func (s *enryBaseTestSuite) SetupSuite() {
var err error
s.tmpLinguistDir, s.isCleanupNeeded, err = maybeCloneLinguist()
require.NoError(s.T(), err)
s.samplesDir = filepath.Join(s.tmpLinguistDir, "samples")
s.testFixturesDir = filepath.Join(s.tmpLinguistDir, "test", "fixtures")
}
func (s *enryBaseTestSuite) TearDownSuite() {
if s.isCleanupNeeded {
err := os.RemoveAll(s.tmpLinguistDir)
require.NoError(s.T(), err)
}
}
type enryTestSuite struct {
enryBaseTestSuite
}
func Test_EnryTestSuite(t *testing.T) {
suite.Run(t, new(enryTestSuite))
}
func (s *enryTestSuite) TestRegexpEdgeCases() {
var regexpEdgeCases = []struct { var regexpEdgeCases = []struct {
lang string lang string
filename string filename string
@ -41,7 +104,7 @@ func (s *EnryTestSuite) TestRegexpEdgeCases() {
} }
for _, r := range regexpEdgeCases { for _, r := range regexpEdgeCases {
filename := filepath.Join(s.tmpLinguist, "samples", r.lang, r.filename) filename := filepath.Join(s.tmpLinguistDir, "samples", r.lang, r.filename)
content, err := ioutil.ReadFile(filename) content, err := ioutil.ReadFile(filename)
require.NoError(s.T(), err) require.NoError(s.T(), err)
@ -54,51 +117,7 @@ func (s *EnryTestSuite) TestRegexpEdgeCases() {
} }
} }
func Test_EnryTestSuite(t *testing.T) { func (s *enryTestSuite) TestGetLanguage() {
suite.Run(t, new(EnryTestSuite))
}
func (s *EnryTestSuite) SetupSuite() {
var err error
s.tmpLinguist = os.Getenv(linguistClonedEnvVar)
s.needToClone = s.tmpLinguist == ""
if s.needToClone {
s.tmpLinguist, err = ioutil.TempDir("", "linguist-")
require.NoError(s.T(), err)
s.T().Logf("Cloning Linguist repo to '%s' as %s was not set\n",
s.tmpLinguist, linguistClonedEnvVar)
cmd := exec.Command("git", "clone", linguistURL, s.tmpLinguist)
err = cmd.Run()
require.NoError(s.T(), err)
}
s.samplesDir = filepath.Join(s.tmpLinguist, "samples")
s.T().Logf("using samples from %s", s.samplesDir)
s.testFixturesDir = filepath.Join(s.tmpLinguist, "test", "fixtures")
s.T().Logf("using test fixtures from %s", s.samplesDir)
cwd, err := os.Getwd()
assert.NoError(s.T(), err)
err = os.Chdir(s.tmpLinguist)
assert.NoError(s.T(), err)
cmd := exec.Command("git", "checkout", data.LinguistCommit)
err = cmd.Run()
assert.NoError(s.T(), err)
err = os.Chdir(cwd)
assert.NoError(s.T(), err)
}
func (s *EnryTestSuite) TearDownSuite() {
if s.needToClone {
err := os.RemoveAll(s.tmpLinguist)
assert.NoError(s.T(), err)
}
}
func (s *EnryTestSuite) TestGetLanguage() {
tests := []struct { tests := []struct {
name string name string
filename string filename string
@ -120,7 +139,7 @@ func (s *EnryTestSuite) TestGetLanguage() {
} }
} }
func (s *EnryTestSuite) TestGetLanguages() { func (s *enryTestSuite) TestGetLanguages() {
tests := []struct { tests := []struct {
name string name string
filename string filename string
@ -152,8 +171,8 @@ func (s *EnryTestSuite) TestGetLanguages() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByModelineLinguist() { func (s *enryTestSuite) TestGetLanguagesByModelineLinguist() {
var modelinesDir = filepath.Join(s.tmpLinguist, "test", "fixtures", "Data", "Modelines") var modelinesDir = filepath.Join(s.tmpLinguistDir, "test", "fixtures", "Data", "Modelines")
tests := []struct { tests := []struct {
name string name string
@ -212,7 +231,7 @@ func (s *EnryTestSuite) TestGetLanguagesByModelineLinguist() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByModeline() { func (s *enryTestSuite) TestGetLanguagesByModeline() {
const ( const (
wrongVim = `# vim: set syntax=ruby ft =python filetype=perl :` wrongVim = `# vim: set syntax=ruby ft =python filetype=perl :`
rightVim = `/* vim: set syntax=python ft =python filetype=python */` rightVim = `/* vim: set syntax=python ft =python filetype=python */`
@ -239,7 +258,7 @@ func (s *EnryTestSuite) TestGetLanguagesByModeline() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByFilename() { func (s *enryTestSuite) TestGetLanguagesByFilename() {
tests := []struct { tests := []struct {
name string name string
filename string filename string
@ -267,7 +286,7 @@ func (s *EnryTestSuite) TestGetLanguagesByFilename() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByShebang() { func (s *enryTestSuite) TestGetLanguagesByShebang() {
const ( const (
multilineExecHack = `#!/bin/sh multilineExecHack = `#!/bin/sh
# Next line is comment in Tcl, but not in sh... \ # Next line is comment in Tcl, but not in sh... \
@ -352,7 +371,26 @@ println("The shell script says ",vm.arglist.concat(" "));`
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByExtension() { func (s *enryTestSuite) TestGetLanguageByContent() {
tests := []struct {
name string
filename string
content []byte
expected string
}{
{name: "TestGetLanguageByContent_0", filename: "", expected: ""},
{name: "TestGetLanguageByContent_1", filename: "foo.cpp", content: []byte("int main() { return 0; }"), expected: ""}, // as .cpp is unambiguous ¯\_(ツ)_/¯
{name: "TestGetLanguageByContent_2", filename: "foo.h", content: []byte("int main() { return 0; }"), expected: "C"}, // C, as it does not match any of the heuristics for C++ or Objective-C
{name: "TestGetLanguageByContent_3", filename: "foo.h", content: []byte("#include <string>\n int main() { return 0; }"), expected: "C++"}, // '#include <string>' matches regex heuristic
}
for _, test := range tests {
languages, _ := GetLanguageByContent(test.filename, test.content)
assert.Equal(s.T(), test.expected, languages, fmt.Sprintf("%v: languages = %v, expected: %v", test.name, languages, test.expected))
}
}
func (s *enryTestSuite) TestGetLanguagesByExtension() {
tests := []struct { tests := []struct {
name string name string
filename string filename string
@ -373,7 +411,7 @@ func (s *EnryTestSuite) TestGetLanguagesByExtension() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByManpage() { func (s *enryTestSuite) TestGetLanguagesByManpage() {
tests := []struct { tests := []struct {
name string name string
filename string filename string
@ -397,7 +435,7 @@ func (s *EnryTestSuite) TestGetLanguagesByManpage() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByXML() { func (s *enryTestSuite) TestGetLanguagesByXML() {
tests := []struct { tests := []struct {
name string name string
filename string filename string
@ -420,7 +458,7 @@ func (s *EnryTestSuite) TestGetLanguagesByXML() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesByClassifier() { func (s *enryTestSuite) TestGetLanguagesByClassifier() {
test := []struct { test := []struct {
name string name string
filename string filename string
@ -457,7 +495,7 @@ func (s *EnryTestSuite) TestGetLanguagesByClassifier() {
} }
} }
func (s *EnryTestSuite) TestGetLanguagesBySpecificClassifier() { func (s *enryTestSuite) TestGetLanguagesBySpecificClassifier() {
test := []struct { test := []struct {
name string name string
filename string filename string
@ -490,7 +528,7 @@ func (s *EnryTestSuite) TestGetLanguagesBySpecificClassifier() {
} }
} }
func (s *EnryTestSuite) TestGetLanguageExtensions() { func (s *enryTestSuite) TestGetLanguageExtensions() {
tests := []struct { tests := []struct {
name string name string
language string language string
@ -507,7 +545,7 @@ func (s *EnryTestSuite) TestGetLanguageExtensions() {
} }
} }
func (s *EnryTestSuite) TestGetLanguageType() { func (s *enryTestSuite) TestGetLanguageType() {
tests := []struct { tests := []struct {
name string name string
language string language string
@ -530,7 +568,7 @@ func (s *EnryTestSuite) TestGetLanguageType() {
} }
} }
func (s *EnryTestSuite) TestGetLanguageGroup() { func (s *enryTestSuite) TestGetLanguageGroup() {
tests := []struct { tests := []struct {
name string name string
language string language string
@ -548,7 +586,7 @@ func (s *EnryTestSuite) TestGetLanguageGroup() {
} }
} }
func (s *EnryTestSuite) TestGetLanguageByAlias() { func (s *enryTestSuite) TestGetLanguageByAlias() {
tests := []struct { tests := []struct {
name string name string
alias string alias string
@ -574,57 +612,7 @@ func (s *EnryTestSuite) TestGetLanguageByAlias() {
} }
} }
func (s *EnryTestSuite) TestLinguistCorpus() { func (s *enryTestSuite) TestGetLanguageID() {
const filenamesDir = "filenames"
var cornerCases = map[string]bool{
"drop_stuff.sql": true, // https://github.com/src-d/enry/issues/194
"textobj-rubyblock.vba": true, // Because of unsupported negative lookahead RE syntax (https://github.com/github/linguist/blob/8083cb5a89cee2d99f5a988f165994d0243f0d1e/lib/linguist/heuristics.yml#L521)
// .es and .ice fail heuristics parsing, but do not fail any tests
}
var total, failed, ok, other int
var expected string
filepath.Walk(s.samplesDir, func(path string, f os.FileInfo, err error) error {
if f.IsDir() {
if f.Name() != filenamesDir {
expected, _ = data.LanguageByAlias(f.Name())
}
return nil
}
filename := filepath.Base(path)
content, _ := ioutil.ReadFile(path)
total++
obtained := GetLanguage(filename, content)
if obtained == OtherLanguage {
obtained = "Other"
other++
}
var status string
if expected == obtained {
status = "ok"
ok++
} else {
status = "failed"
failed++
}
if _, ok := cornerCases[filename]; ok {
s.T().Logf("\t\t[considered corner case] %s\texpected: %s\tobtained: %s\tstatus: %s\n", filename, expected, obtained, status)
} else {
assert.Equal(s.T(), expected, obtained, fmt.Sprintf("%s\texpected: %s\tobtained: %s\tstatus: %s\n", filename, expected, obtained, status))
}
return nil
})
s.T().Logf("\t\ttotal files: %d, ok: %d, failed: %d, other: %d\n", total, ok, failed, other)
}
func (s *EnryTestSuite) TestGetLanguageID() {
tests := []struct { tests := []struct {
name string name string
language string language string
@ -647,7 +635,7 @@ func (s *EnryTestSuite) TestGetLanguageID() {
} }
} }
func (s *EnryTestSuite) TestGetLanguageInfo() { func (s *enryTestSuite) TestGetLanguageInfo() {
tests := []struct { tests := []struct {
name string name string
language string language string
@ -674,7 +662,7 @@ func (s *EnryTestSuite) TestGetLanguageInfo() {
} }
} }
func (s *EnryTestSuite) TestGetLanguageInfoByID() { func (s *enryTestSuite) TestGetLanguageInfoByID() {
tests := []struct { tests := []struct {
name string name string
id int id int

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -44,6 +44,7 @@ var LanguageByAliasMap = map[string]string{
"amusewiki": "Muse", "amusewiki": "Muse",
"angelscript": "AngelScript", "angelscript": "AngelScript",
"ant_build_system": "Ant Build System", "ant_build_system": "Ant Build System",
"antlers": "Antlers",
"antlr": "ANTLR", "antlr": "ANTLR",
"apache": "ApacheConf", "apache": "ApacheConf",
"apacheconf": "ApacheConf", "apacheconf": "ApacheConf",
@ -56,6 +57,7 @@ var LanguageByAliasMap = map[string]string{
"arc": "Arc", "arc": "Arc",
"arexx": "REXX", "arexx": "REXX",
"as3": "ActionScript", "as3": "ActionScript",
"ascii_stl": "STL",
"asciidoc": "AsciiDoc", "asciidoc": "AsciiDoc",
"asl": "ASL", "asl": "ASL",
"asm": "Assembly", "asm": "Assembly",
@ -94,6 +96,7 @@ var LanguageByAliasMap = map[string]string{
"berry": "Berry", "berry": "Berry",
"bibtex": "BibTeX", "bibtex": "BibTeX",
"bicep": "Bicep", "bicep": "Bicep",
"bikeshed": "Bikeshed",
"bison": "Bison", "bison": "Bison",
"bitbake": "BitBake", "bitbake": "BitBake",
"blade": "Blade", "blade": "Blade",
@ -107,6 +110,7 @@ var LanguageByAliasMap = map[string]string{
"boogie": "Boogie", "boogie": "Boogie",
"bplus": "BlitzBasic", "bplus": "BlitzBasic",
"brainfuck": "Brainfuck", "brainfuck": "Brainfuck",
"brighterscript": "BrighterScript",
"brightscript": "Brightscript", "brightscript": "Brightscript",
"bro": "Zeek", "bro": "Zeek",
"browserslist": "Browserslist", "browserslist": "Browserslist",
@ -128,14 +132,18 @@ var LanguageByAliasMap = map[string]string{
"cakescript": "C#", "cakescript": "C#",
"cameligo": "CameLIGO", "cameligo": "CameLIGO",
"cap'n_proto": "Cap'n Proto", "cap'n_proto": "Cap'n Proto",
"cap_cds": "CAP CDS",
"carto": "CartoCSS", "carto": "CartoCSS",
"cartocss": "CartoCSS", "cartocss": "CartoCSS",
"cds": "CAP CDS",
"ceylon": "Ceylon", "ceylon": "Ceylon",
"cfc": "ColdFusion CFC", "cfc": "ColdFusion CFC",
"cfm": "ColdFusion", "cfm": "ColdFusion",
"cfml": "ColdFusion", "cfml": "ColdFusion",
"chapel": "Chapel", "chapel": "Chapel",
"charity": "Charity", "charity": "Charity",
"checksum": "Checksums",
"checksums": "Checksums",
"chpl": "Chapel", "chpl": "Chapel",
"chuck": "ChucK", "chuck": "ChucK",
"cil": "CIL", "cil": "CIL",
@ -293,6 +301,7 @@ var LanguageByAliasMap = map[string]string{
"gaml": "GAML", "gaml": "GAML",
"gams": "GAMS", "gams": "GAMS",
"gap": "GAP", "gap": "GAP",
"gas": "Unix Assembly",
"gcc_machine_description": "GCC Machine Description", "gcc_machine_description": "GCC Machine Description",
"gdb": "GDB", "gdb": "GDB",
"gdscript": "GDScript", "gdscript": "GDScript",
@ -304,13 +313,16 @@ var LanguageByAliasMap = map[string]string{
"genshi": "Genshi", "genshi": "Genshi",
"gentoo_ebuild": "Gentoo Ebuild", "gentoo_ebuild": "Gentoo Ebuild",
"gentoo_eclass": "Gentoo Eclass", "gentoo_eclass": "Gentoo Eclass",
"geojson": "JSON",
"gerber_image": "Gerber Image", "gerber_image": "Gerber Image",
"gettext_catalog": "Gettext Catalog", "gettext_catalog": "Gettext Catalog",
"gf": "Grammatical Framework", "gf": "Grammatical Framework",
"gherkin": "Gherkin", "gherkin": "Gherkin",
"git-ignore": "Ignore List", "git-ignore": "Ignore List",
"git_attributes": "Git Attributes", "git_attributes": "Git Attributes",
"git_blame_ignore_revs": "Git Revision List",
"git_config": "Git Config", "git_config": "Git Config",
"git_revision_list": "Git Revision List",
"gitattributes": "Git Attributes", "gitattributes": "Git Attributes",
"gitconfig": "Git Config", "gitconfig": "Git Config",
"gitignore": "Ignore List", "gitignore": "Ignore List",
@ -320,6 +332,7 @@ var LanguageByAliasMap = map[string]string{
"glyph": "Glyph", "glyph": "Glyph",
"glyph_bitmap_distribution_format": "Glyph Bitmap Distribution Format", "glyph_bitmap_distribution_format": "Glyph Bitmap Distribution Format",
"gn": "GN", "gn": "GN",
"gnu_asm": "Unix Assembly",
"gnuplot": "Gnuplot", "gnuplot": "Gnuplot",
"go": "Go", "go": "Go",
"go.mod": "Go Module", "go.mod": "Go Module",
@ -347,6 +360,8 @@ var LanguageByAliasMap = map[string]string{
"handlebars": "Handlebars", "handlebars": "Handlebars",
"haproxy": "HAProxy", "haproxy": "HAProxy",
"harbour": "Harbour", "harbour": "Harbour",
"hash": "Checksums",
"hashes": "Checksums",
"hashicorp_configuration_language": "HCL", "hashicorp_configuration_language": "HCL",
"haskell": "Haskell", "haskell": "Haskell",
"haxe": "Haxe", "haxe": "Haxe",
@ -410,6 +425,7 @@ var LanguageByAliasMap = map[string]string{
"javascript": "JavaScript", "javascript": "JavaScript",
"javascript+erb": "JavaScript+ERB", "javascript+erb": "JavaScript+ERB",
"jest_snapshot": "Jest Snapshot", "jest_snapshot": "Jest Snapshot",
"jetbrains_mps": "JetBrains MPS",
"jflex": "JFlex", "jflex": "JFlex",
"jinja": "Jinja", "jinja": "Jinja",
"jison": "Jison", "jison": "Jison",
@ -423,6 +439,7 @@ var LanguageByAliasMap = map[string]string{
"json_with_comments": "JSON with Comments", "json_with_comments": "JSON with Comments",
"jsonc": "JSON with Comments", "jsonc": "JSON with Comments",
"jsoniq": "JSONiq", "jsoniq": "JSONiq",
"jsonl": "JSON",
"jsonld": "JSONLD", "jsonld": "JSONLD",
"jsonnet": "Jsonnet", "jsonnet": "Jsonnet",
"jsp": "Java Server Pages", "jsp": "Java Server Pages",
@ -532,6 +549,7 @@ var LanguageByAliasMap = map[string]string{
"moonscript": "MoonScript", "moonscript": "MoonScript",
"motoko": "Motoko", "motoko": "Motoko",
"motorola_68k_assembly": "Motorola 68K Assembly", "motorola_68k_assembly": "Motorola 68K Assembly",
"mps": "JetBrains MPS",
"mql4": "MQL4", "mql4": "MQL4",
"mql5": "MQL5", "mql5": "MQL5",
"mtml": "MTML", "mtml": "MTML",
@ -649,6 +667,7 @@ var LanguageByAliasMap = map[string]string{
"pod_6": "Pod 6", "pod_6": "Pod 6",
"pogoscript": "PogoScript", "pogoscript": "PogoScript",
"pony": "Pony", "pony": "Pony",
"portugol": "Portugol",
"posh": "PowerShell", "posh": "PowerShell",
"postcss": "PostCSS", "postcss": "PostCSS",
"postscr": "PostScript", "postscr": "PostScript",
@ -810,13 +829,18 @@ var LanguageByAliasMap = map[string]string{
"ssh_config": "SSH Config", "ssh_config": "SSH Config",
"stan": "Stan", "stan": "Stan",
"standard_ml": "Standard ML", "standard_ml": "Standard ML",
"star": "STAR",
"starlark": "Starlark", "starlark": "Starlark",
"stata": "Stata", "stata": "Stata",
"stl": "STL",
"stla": "STL",
"ston": "STON", "ston": "STON",
"stringtemplate": "StringTemplate", "stringtemplate": "StringTemplate",
"stylus": "Stylus", "stylus": "Stylus",
"subrip_text": "SubRip Text", "subrip_text": "SubRip Text",
"sugarss": "SugarSS", "sugarss": "SugarSS",
"sum": "Checksums",
"sums": "Checksums",
"supercollider": "SuperCollider", "supercollider": "SuperCollider",
"svelte": "Svelte", "svelte": "Svelte",
"svg": "SVG", "svg": "SVG",
@ -841,6 +865,7 @@ var LanguageByAliasMap = map[string]string{
"tla": "TLA", "tla": "TLA",
"tm-properties": "TextMate Properties", "tm-properties": "TextMate Properties",
"toml": "TOML", "toml": "TOML",
"topojson": "JSON",
"troff": "Roff", "troff": "Roff",
"ts": "TypeScript", "ts": "TypeScript",
"tsql": "TSQL", "tsql": "TSQL",
@ -857,6 +882,7 @@ var LanguageByAliasMap = map[string]string{
"ultisnips": "Vim Snippet", "ultisnips": "Vim Snippet",
"unified_parallel_c": "Unified Parallel C", "unified_parallel_c": "Unified Parallel C",
"unity3d_asset": "Unity3D Asset", "unity3d_asset": "Unity3D Asset",
"unix_asm": "Unix Assembly",
"unix_assembly": "Unix Assembly", "unix_assembly": "Unix Assembly",
"uno": "Uno", "uno": "Uno",
"unrealscript": "UnrealScript", "unrealscript": "UnrealScript",
@ -888,6 +914,7 @@ var LanguageByAliasMap = map[string]string{
"visual_basic_for_applications": "VBA", "visual_basic_for_applications": "VBA",
"vlang": "V", "vlang": "V",
"volt": "Volt", "volt": "Volt",
"vtt": "WebVTT",
"vue": "Vue", "vue": "Vue",
"vyper": "Vyper", "vyper": "Vyper",
"wasm": "WebAssembly", "wasm": "WebAssembly",
@ -901,6 +928,7 @@ var LanguageByAliasMap = map[string]string{
"webvtt": "WebVTT", "webvtt": "WebVTT",
"wget_config": "Wget Config", "wget_config": "Wget Config",
"wgetrc": "Wget Config", "wgetrc": "Wget Config",
"whiley": "Whiley",
"wiki": "Wikitext", "wiki": "Wikitext",
"wikitext": "Wikitext", "wikitext": "Wikitext",
"win32_message_file": "Win32 Message File", "win32_message_file": "Win32 Message File",
@ -948,6 +976,7 @@ var LanguageByAliasMap = map[string]string{
"yas": "YASnippet", "yas": "YASnippet",
"yasnippet": "YASnippet", "yasnippet": "YASnippet",
"yml": "YAML", "yml": "YAML",
"yul": "Yul",
"zap": "ZAP", "zap": "ZAP",
"zeek": "Zeek", "zeek": "Zeek",
"zenscript": "ZenScript", "zenscript": "ZenScript",
@ -969,8 +998,9 @@ func LanguageByAlias(langOrAlias string) (lang string, ok bool) {
// convertToAliasKey converts language name to a key in LanguageByAliasMap. // convertToAliasKey converts language name to a key in LanguageByAliasMap.
// Following // Following
// - internal.code-generator.generator.convertToAliasKey() // - internal.code-generator.generator.convertToAliasKey()
// - GetLanguageByAlias() // - GetLanguageByAlias()
//
// conventions. // conventions.
// It is here to avoid dependency on "generate" and "enry" packages. // It is here to avoid dependency on "generate" and "enry" packages.
func convertToAliasKey(langName string) string { func convertToAliasKey(langName string) string {

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -27,6 +27,7 @@ var LanguagesColor = map[string]string{
"Altium Designer": "#A89663", "Altium Designer": "#A89663",
"AngelScript": "#C7D7DC", "AngelScript": "#C7D7DC",
"Ant Build System": "#A9157E", "Ant Build System": "#A9157E",
"Antlers": "#ff269e",
"ApacheConf": "#d12127", "ApacheConf": "#d12127",
"Apex": "#1797c0", "Apex": "#1797c0",
"Apollo Guidance Computer": "#0B3D91", "Apollo Guidance Computer": "#0B3D91",
@ -49,6 +50,7 @@ var LanguagesColor = map[string]string{
"Berry": "#15A13C", "Berry": "#15A13C",
"BibTeX": "#778899", "BibTeX": "#778899",
"Bicep": "#519aba", "Bicep": "#519aba",
"Bikeshed": "#5562ac",
"Bison": "#6A463F", "Bison": "#6A463F",
"BitBake": "#00bce4", "BitBake": "#00bce4",
"Blade": "#f7523f", "Blade": "#f7523f",
@ -58,11 +60,13 @@ var LanguagesColor = map[string]string{
"Boo": "#d4bec1", "Boo": "#d4bec1",
"Boogie": "#c80fa0", "Boogie": "#c80fa0",
"Brainfuck": "#2F2530", "Brainfuck": "#2F2530",
"BrighterScript": "#66AABB",
"Brightscript": "#662D91", "Brightscript": "#662D91",
"Browserslist": "#ffd539", "Browserslist": "#ffd539",
"C": "#555555", "C": "#555555",
"C#": "#178600", "C#": "#178600",
"C++": "#f34b7d", "C++": "#f34b7d",
"CAP CDS": "#0092d1",
"CLIPS": "#00A300", "CLIPS": "#00A300",
"CMake": "#DA3434", "CMake": "#DA3434",
"COLLADA": "#F1A42B", "COLLADA": "#F1A42B",
@ -171,6 +175,7 @@ var LanguagesColor = map[string]string{
"Gherkin": "#5B2063", "Gherkin": "#5B2063",
"Git Attributes": "#F44D27", "Git Attributes": "#F44D27",
"Git Config": "#F44D27", "Git Config": "#F44D27",
"Git Revision List": "#F44D27",
"Gleam": "#ffaff3", "Gleam": "#ffaff3",
"Glyph": "#c1ac7f", "Glyph": "#c1ac7f",
"Gnuplot": "#f0a9f0", "Gnuplot": "#f0a9f0",
@ -232,6 +237,7 @@ var LanguagesColor = map[string]string{
"JavaScript": "#f1e05a", "JavaScript": "#f1e05a",
"JavaScript+ERB": "#f1e05a", "JavaScript+ERB": "#f1e05a",
"Jest Snapshot": "#15c213", "Jest Snapshot": "#15c213",
"JetBrains MPS": "#21D789",
"Jinja": "#a52a22", "Jinja": "#a52a22",
"Jison": "#56b3cb", "Jison": "#56b3cb",
"Jison Lex": "#56b3cb", "Jison Lex": "#56b3cb",
@ -344,6 +350,7 @@ var LanguagesColor = map[string]string{
"PigLatin": "#fcd7de", "PigLatin": "#fcd7de",
"Pike": "#005390", "Pike": "#005390",
"PogoScript": "#d80074", "PogoScript": "#d80074",
"Portugol": "#f8bd00",
"PostCSS": "#dc3a0c", "PostCSS": "#dc3a0c",
"PostScript": "#da291c", "PostScript": "#da291c",
"PowerBuilder": "#8f0f8d", "PowerBuilder": "#8f0f8d",
@ -399,6 +406,7 @@ var LanguagesColor = map[string]string{
"SQL": "#e38c00", "SQL": "#e38c00",
"SQLPL": "#e38c00", "SQLPL": "#e38c00",
"SRecode Template": "#348a34", "SRecode Template": "#348a34",
"STL": "#373b5e",
"SVG": "#ff9900", "SVG": "#ff9900",
"SaltStack": "#646464", "SaltStack": "#646464",
"Sass": "#a53b70", "Sass": "#a53b70",
@ -438,7 +446,7 @@ var LanguagesColor = map[string]string{
"TOML": "#9c4221", "TOML": "#9c4221",
"TSQL": "#e38c00", "TSQL": "#e38c00",
"TSV": "#237346", "TSV": "#237346",
"TSX": "#2b7489", "TSX": "#3178c6",
"TXL": "#0178b8", "TXL": "#0178b8",
"Talon": "#333333", "Talon": "#333333",
"Tcl": "#e4cc98", "Tcl": "#e4cc98",
@ -449,7 +457,7 @@ var LanguagesColor = map[string]string{
"Thrift": "#D12127", "Thrift": "#D12127",
"Turing": "#cf142b", "Turing": "#cf142b",
"Twig": "#c1d026", "Twig": "#c1d026",
"TypeScript": "#2b7489", "TypeScript": "#3178c6",
"Unified Parallel C": "#4e3617", "Unified Parallel C": "#4e3617",
"Unity3D Asset": "#222c37", "Unity3D Asset": "#222c37",
"Uno": "#9933cc", "Uno": "#9933cc",
@ -472,6 +480,7 @@ var LanguagesColor = map[string]string{
"Vyper": "#2980b9", "Vyper": "#2980b9",
"Web Ontology Language": "#5b70bd", "Web Ontology Language": "#5b70bd",
"WebAssembly": "#04133b", "WebAssembly": "#04133b",
"Whiley": "#d5c397",
"Wikitext": "#fc5757", "Wikitext": "#fc5757",
"Windows Registry Entries": "#52d5ff", "Windows Registry Entries": "#52d5ff",
"Witcher Script": "#ff0000", "Witcher Script": "#ff0000",
@ -490,6 +499,7 @@ var LanguagesColor = map[string]string{
"YARA": "#220000", "YARA": "#220000",
"YASnippet": "#32AB90", "YASnippet": "#32AB90",
"Yacc": "#4B6C4B", "Yacc": "#4B6C4B",
"Yul": "#794932",
"ZAP": "#0d665e", "ZAP": "#0d665e",
"ZIL": "#dc75e5", "ZIL": "#dc75e5",
"ZenScript": "#00BCD1", "ZenScript": "#00BCD1",

View File

@ -1,7 +1,7 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
// linguist's commit from which files were generated. // linguist's commit from which files were generated.
var LinguistCommit = "4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26" var LinguistCommit = "d7799da826e01acdb8f84694d33116dccaabe9c2"

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -638,6 +638,10 @@ var ContentHeuristics = map[string]*Heuristics{
rule.MatchingLanguages("BitBake"), rule.MatchingLanguages("BitBake"),
regexp.MustCompile(`(?m)^\s*(# |include|require)\b`), regexp.MustCompile(`(?m)^\s*(# |include|require)\b`),
), ),
rule.Or(
rule.MatchingLanguages("Clojure"),
regexp.MustCompile(`(?m)\((def|defn|defmacro|let)\s`),
),
}, },
".bi": &Heuristics{ ".bi": &Heuristics{
rule.Or( rule.Or(
@ -645,6 +649,7 @@ var ContentHeuristics = map[string]*Heuristics{
regexp.MustCompile(`(?m)^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s`), regexp.MustCompile(`(?m)^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s`),
), ),
}, },
".bs": &Heuristics{},
".builds": &Heuristics{ ".builds": &Heuristics{
rule.Or( rule.Or(
rule.MatchingLanguages("XML"), rule.MatchingLanguages("XML"),
@ -1472,6 +1477,16 @@ var ContentHeuristics = map[string]*Heuristics{
regexp.MustCompile(`(?m)\A\s*[\[{(^"'\w#]|[a-zA-Z_]\w*\s*:=\s*[a-zA-Z_]\w*|class\s*>>\s*[a-zA-Z_]\w*|^[a-zA-Z_]\w*\s+[a-zA-Z_]\w*:|^Class\s*{|if(?:True|False):\s*\[`), regexp.MustCompile(`(?m)\A\s*[\[{(^"'\w#]|[a-zA-Z_]\w*\s*:=\s*[a-zA-Z_]\w*|class\s*>>\s*[a-zA-Z_]\w*|^[a-zA-Z_]\w*\s+[a-zA-Z_]\w*:|^Class\s*{|if(?:True|False):\s*\[`),
), ),
}, },
".star": &Heuristics{
rule.Or(
rule.MatchingLanguages("STAR"),
regexp.MustCompile(`(?m)^loop_\s*$`),
),
rule.Always(
rule.MatchingLanguages("Starlark"),
),
},
".stl": &Heuristics{},
".t": &Heuristics{ ".t": &Heuristics{
rule.Or( rule.Or(
rule.MatchingLanguages("Perl"), rule.MatchingLanguages("Perl"),

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -18,7 +18,9 @@ var LanguagesByExtension = map[string][]string{
".3qt": {"Roff", "Roff Manpage"}, ".3qt": {"Roff", "Roff Manpage"},
".3x": {"Roff", "Roff Manpage"}, ".3x": {"Roff", "Roff Manpage"},
".4": {"Roff", "Roff Manpage"}, ".4": {"Roff", "Roff Manpage"},
".4dform": {"JSON"},
".4dm": {"4D"}, ".4dm": {"4D"},
".4dproject": {"JSON"},
".4gl": {"Genero"}, ".4gl": {"Genero"},
".4th": {"Forth"}, ".4th": {"Forth"},
".5": {"Roff", "Roff Manpage"}, ".5": {"Roff", "Roff Manpage"},
@ -59,6 +61,9 @@ var LanguagesByExtension = map[string][]string{
".angelscript": {"AngelScript"}, ".angelscript": {"AngelScript"},
".anim": {"Unity3D Asset"}, ".anim": {"Unity3D Asset"},
".ant": {"XML"}, ".ant": {"XML"},
".antlers.html": {"Antlers"},
".antlers.php": {"Antlers"},
".antlers.xml": {"Antlers"},
".apacheconf": {"ApacheConf"}, ".apacheconf": {"ApacheConf"},
".apib": {"API Blueprint"}, ".apib": {"API Blueprint"},
".apl": {"APL"}, ".apl": {"APL"},
@ -106,7 +111,7 @@ var LanguagesByExtension = map[string][]string{
".bash": {"Shell"}, ".bash": {"Shell"},
".bat": {"Batchfile"}, ".bat": {"Batchfile"},
".bats": {"Shell"}, ".bats": {"Shell"},
".bb": {"BitBake", "BlitzBasic"}, ".bb": {"BitBake", "BlitzBasic", "Clojure"},
".bbx": {"TeX"}, ".bbx": {"TeX"},
".bdf": {"Glyph Bitmap Distribution Format"}, ".bdf": {"Glyph Bitmap Distribution Format"},
".bdy": {"PLSQL"}, ".bdy": {"PLSQL"},
@ -128,6 +133,7 @@ var LanguagesByExtension = map[string][]string{
".brd": {"Eagle", "KiCad Legacy Layout"}, ".brd": {"Eagle", "KiCad Legacy Layout"},
".bro": {"Zeek"}, ".bro": {"Zeek"},
".brs": {"Brightscript"}, ".brs": {"Brightscript"},
".bs": {"Bikeshed", "BrighterScript"},
".bsl": {"1C Enterprise"}, ".bsl": {"1C Enterprise"},
".bsv": {"Bluespec"}, ".bsv": {"Bluespec"},
".builder": {"Ruby"}, ".builder": {"Ruby"},
@ -151,6 +157,7 @@ var LanguagesByExtension = map[string][]string{
".ccxml": {"XML"}, ".ccxml": {"XML"},
".cdc": {"Cadence"}, ".cdc": {"Cadence"},
".cdf": {"Mathematica"}, ".cdf": {"Mathematica"},
".cds": {"CAP CDS"},
".ceylon": {"Ceylon"}, ".ceylon": {"Ceylon"},
".cfc": {"ColdFusion CFC"}, ".cfc": {"ColdFusion CFC"},
".cfg": {"HAProxy", "INI"}, ".cfg": {"HAProxy", "INI"},
@ -206,6 +213,7 @@ var LanguagesByExtension = map[string][]string{
".cpy": {"COBOL"}, ".cpy": {"COBOL"},
".cql": {"SQL"}, ".cql": {"SQL"},
".cr": {"Crystal"}, ".cr": {"Crystal"},
".crc32": {"Checksums"},
".creole": {"Creole"}, ".creole": {"Creole"},
".cs": {"C#", "Smalltalk"}, ".cs": {"C#", "Smalltalk"},
".csc": {"GSC"}, ".csc": {"GSC"},
@ -222,6 +230,7 @@ var LanguagesByExtension = map[string][]string{
".csx": {"C#"}, ".csx": {"C#"},
".ct": {"XML"}, ".ct": {"XML"},
".ctp": {"PHP"}, ".ctp": {"PHP"},
".cts": {"TypeScript"},
".cu": {"Cuda"}, ".cu": {"Cuda"},
".cue": {"CUE", "Cue Sheet"}, ".cue": {"CUE", "Cue Sheet"},
".cuh": {"Cuda"}, ".cuh": {"Cuda"},
@ -350,6 +359,7 @@ var LanguagesByExtension = map[string][]string{
".fsi": {"F#"}, ".fsi": {"F#"},
".fsproj": {"XML"}, ".fsproj": {"XML"},
".fst": {"F*"}, ".fst": {"F*"},
".fsti": {"F*"},
".fsx": {"F#"}, ".fsx": {"F#"},
".fth": {"Forth"}, ".fth": {"Forth"},
".ftl": {"Fluent", "FreeMarker"}, ".ftl": {"Fluent", "FreeMarker"},
@ -540,6 +550,7 @@ var LanguagesByExtension = map[string][]string{
".kak": {"KakouneScript"}, ".kak": {"KakouneScript"},
".kicad_mod": {"KiCad Layout"}, ".kicad_mod": {"KiCad Layout"},
".kicad_pcb": {"KiCad Layout"}, ".kicad_pcb": {"KiCad Layout"},
".kicad_sch": {"KiCad Schematic"},
".kicad_wks": {"KiCad Layout"}, ".kicad_wks": {"KiCad Layout"},
".kid": {"Genshi"}, ".kid": {"Genshi"},
".kit": {"Kit"}, ".kit": {"Kit"},
@ -579,6 +590,7 @@ var LanguagesByExtension = map[string][]string{
".liquid": {"Liquid"}, ".liquid": {"Liquid"},
".lisp": {"Common Lisp", "NewLisp"}, ".lisp": {"Common Lisp", "NewLisp"},
".litcoffee": {"Literate CoffeeScript"}, ".litcoffee": {"Literate CoffeeScript"},
".livemd": {"Markdown"},
".ll": {"LLVM"}, ".ll": {"LLVM"},
".lmi": {"Python"}, ".lmi": {"Python"},
".logtalk": {"Logtalk"}, ".logtalk": {"Logtalk"},
@ -591,6 +603,7 @@ var LanguagesByExtension = map[string][]string{
".lsp": {"Common Lisp", "NewLisp"}, ".lsp": {"Common Lisp", "NewLisp"},
".ltx": {"TeX"}, ".ltx": {"TeX"},
".lua": {"Lua"}, ".lua": {"Lua"},
".lvclass": {"LabVIEW"},
".lvlib": {"LabVIEW"}, ".lvlib": {"LabVIEW"},
".lvproj": {"LabVIEW"}, ".lvproj": {"LabVIEW"},
".ly": {"LilyPond"}, ".ly": {"LilyPond"},
@ -623,6 +636,9 @@ var LanguagesByExtension = map[string][]string{
".mcmeta": {"JSON"}, ".mcmeta": {"JSON"},
".mcr": {"MAXScript"}, ".mcr": {"MAXScript"},
".md": {"GCC Machine Description", "Markdown"}, ".md": {"GCC Machine Description", "Markdown"},
".md2": {"Checksums"},
".md4": {"Checksums"},
".md5": {"Checksums"},
".mdoc": {"Roff", "Roff Manpage"}, ".mdoc": {"Roff", "Roff Manpage"},
".mdown": {"Markdown"}, ".mdown": {"Markdown"},
".mdpolicy": {"XML"}, ".mdpolicy": {"XML"},
@ -664,16 +680,20 @@ var LanguagesByExtension = map[string][]string{
".monkey2": {"Monkey"}, ".monkey2": {"Monkey"},
".moo": {"Mercury", "Moocode"}, ".moo": {"Mercury", "Moocode"},
".moon": {"MoonScript"}, ".moon": {"MoonScript"},
".mpl": {"JetBrains MPS"},
".mps": {"JetBrains MPS"},
".mq4": {"MQL4"}, ".mq4": {"MQL4"},
".mq5": {"MQL5"}, ".mq5": {"MQL5"},
".mqh": {"MQL4", "MQL5"}, ".mqh": {"MQL4", "MQL5"},
".mrc": {"mIRC Script"}, ".mrc": {"mIRC Script"},
".ms": {"MAXScript", "Roff", "Unix Assembly"}, ".ms": {"MAXScript", "Roff", "Unix Assembly"},
".msd": {"JetBrains MPS"},
".mspec": {"Ruby"}, ".mspec": {"Ruby"},
".mss": {"CartoCSS"}, ".mss": {"CartoCSS"},
".mt": {"Mathematica"}, ".mt": {"Mathematica"},
".mtl": {"Wavefront Material"}, ".mtl": {"Wavefront Material"},
".mtml": {"MTML"}, ".mtml": {"MTML"},
".mts": {"TypeScript"},
".mu": {"mupad"}, ".mu": {"mupad"},
".mud": {"ZIL"}, ".mud": {"ZIL"},
".muf": {"MUF"}, ".muf": {"MUF"},
@ -819,6 +839,7 @@ var LanguagesByExtension = map[string][]string{
".podspec": {"Ruby"}, ".podspec": {"Ruby"},
".pogo": {"PogoScript"}, ".pogo": {"PogoScript"},
".pony": {"Pony"}, ".pony": {"Pony"},
".por": {"Portugol"},
".postcss": {"PostCSS"}, ".postcss": {"PostCSS"},
".pot": {"Gettext Catalog"}, ".pot": {"Gettext Catalog"},
".pov": {"POV-Ray SDL"}, ".pov": {"POV-Ray SDL"},
@ -978,6 +999,14 @@ var LanguagesByExtension = map[string][]string{
".sh": {"Shell"}, ".sh": {"Shell"},
".sh-session": {"ShellSession"}, ".sh-session": {"ShellSession"},
".sh.in": {"Shell"}, ".sh.in": {"Shell"},
".sha1": {"Checksums"},
".sha2": {"Checksums"},
".sha224": {"Checksums"},
".sha256": {"Checksums"},
".sha256sum": {"Checksums"},
".sha3": {"Checksums"},
".sha384": {"Checksums"},
".sha512": {"Checksums"},
".shader": {"GLSL", "ShaderLab"}, ".shader": {"GLSL", "ShaderLab"},
".shen": {"Shen"}, ".shen": {"Shen"},
".shproj": {"XML"}, ".shproj": {"XML"},
@ -1021,7 +1050,9 @@ var LanguagesByExtension = map[string][]string{
".sss": {"SugarSS"}, ".sss": {"SugarSS"},
".st": {"Smalltalk", "StringTemplate"}, ".st": {"Smalltalk", "StringTemplate"},
".stan": {"Stan"}, ".stan": {"Stan"},
".star": {"STAR", "Starlark"},
".sthlp": {"Stata"}, ".sthlp": {"Stata"},
".stl": {"STL"},
".ston": {"STON"}, ".ston": {"STON"},
".story": {"Gherkin"}, ".story": {"Gherkin"},
".storyboard": {"XML"}, ".storyboard": {"XML"},
@ -1166,6 +1197,7 @@ var LanguagesByExtension = map[string][]string{
".webidl": {"WebIDL"}, ".webidl": {"WebIDL"},
".webmanifest": {"JSON"}, ".webmanifest": {"JSON"},
".weechatlog": {"IRC log"}, ".weechatlog": {"IRC log"},
".whiley": {"Whiley"},
".wiki": {"Wikitext"}, ".wiki": {"Wikitext"},
".wikitext": {"Wikitext"}, ".wikitext": {"Wikitext"},
".wisp": {"wisp"}, ".wisp": {"wisp"},
@ -1245,6 +1277,7 @@ var LanguagesByExtension = map[string][]string{
".yml": {"YAML"}, ".yml": {"YAML"},
".yml.mysql": {"YAML"}, ".yml.mysql": {"YAML"},
".yrl": {"Erlang"}, ".yrl": {"Erlang"},
".yul": {"Yul"},
".yy": {"JSON", "Yacc"}, ".yy": {"JSON", "Yacc"},
".yyp": {"JSON"}, ".yyp": {"JSON"},
".zap": {"ZAP"}, ".zap": {"ZAP"},
@ -1287,6 +1320,7 @@ var ExtensionsByLanguage = map[string][]string{
"Alloy": {".als"}, "Alloy": {".als"},
"Altium Designer": {".outjob", ".pcbdoc", ".prjpcb", ".schdoc"}, "Altium Designer": {".outjob", ".pcbdoc", ".prjpcb", ".schdoc"},
"AngelScript": {".as", ".angelscript"}, "AngelScript": {".as", ".angelscript"},
"Antlers": {".antlers.html", ".antlers.php", ".antlers.xml"},
"ApacheConf": {".apacheconf", ".vhost"}, "ApacheConf": {".apacheconf", ".vhost"},
"Apex": {".cls"}, "Apex": {".cls"},
"Apollo Guidance Computer": {".agc"}, "Apollo Guidance Computer": {".agc"},
@ -1310,6 +1344,7 @@ var ExtensionsByLanguage = map[string][]string{
"Berry": {".be"}, "Berry": {".be"},
"BibTeX": {".bib", ".bibtex"}, "BibTeX": {".bib", ".bibtex"},
"Bicep": {".bicep"}, "Bicep": {".bicep"},
"Bikeshed": {".bs"},
"Bison": {".bison"}, "Bison": {".bison"},
"BitBake": {".bb"}, "BitBake": {".bb"},
"Blade": {".blade", ".blade.php"}, "Blade": {".blade", ".blade.php"},
@ -1319,12 +1354,14 @@ var ExtensionsByLanguage = map[string][]string{
"Boo": {".boo"}, "Boo": {".boo"},
"Boogie": {".bpl"}, "Boogie": {".bpl"},
"Brainfuck": {".b", ".bf"}, "Brainfuck": {".b", ".bf"},
"BrighterScript": {".bs"},
"Brightscript": {".brs"}, "Brightscript": {".brs"},
"C": {".c", ".cats", ".h", ".idc"}, "C": {".c", ".cats", ".h", ".idc"},
"C#": {".cs", ".cake", ".csx", ".linq"}, "C#": {".cs", ".cake", ".csx", ".linq"},
"C++": {".cpp", ".c++", ".cc", ".cp", ".cxx", ".h", ".h++", ".hh", ".hpp", ".hxx", ".inc", ".inl", ".ino", ".ipp", ".ixx", ".re", ".tcc", ".tpp"}, "C++": {".cpp", ".c++", ".cc", ".cp", ".cxx", ".h", ".h++", ".hh", ".hpp", ".hxx", ".inc", ".inl", ".ino", ".ipp", ".ixx", ".re", ".tcc", ".tpp"},
"C-ObjDump": {".c-objdump"}, "C-ObjDump": {".c-objdump"},
"C2hs Haskell": {".chs"}, "C2hs Haskell": {".chs"},
"CAP CDS": {".cds"},
"CIL": {".cil"}, "CIL": {".cil"},
"CLIPS": {".clp"}, "CLIPS": {".clp"},
"CMake": {".cmake", ".cmake.in"}, "CMake": {".cmake", ".cmake.in"},
@ -1344,6 +1381,7 @@ var ExtensionsByLanguage = map[string][]string{
"Ceylon": {".ceylon"}, "Ceylon": {".ceylon"},
"Chapel": {".chpl"}, "Chapel": {".chpl"},
"Charity": {".ch"}, "Charity": {".ch"},
"Checksums": {".crc32", ".md2", ".md4", ".md5", ".sha1", ".sha2", ".sha224", ".sha256", ".sha256sum", ".sha3", ".sha384", ".sha512"},
"ChucK": {".ck"}, "ChucK": {".ck"},
"Cirru": {".cirru"}, "Cirru": {".cirru"},
"Clarion": {".clw"}, "Clarion": {".clw"},
@ -1351,7 +1389,7 @@ var ExtensionsByLanguage = map[string][]string{
"Classic ASP": {".asp"}, "Classic ASP": {".asp"},
"Clean": {".icl", ".dcl"}, "Clean": {".icl", ".dcl"},
"Click": {".click"}, "Click": {".click"},
"Clojure": {".clj", ".boot", ".cl2", ".cljc", ".cljs", ".cljs.hl", ".cljscm", ".cljx", ".hic"}, "Clojure": {".clj", ".bb", ".boot", ".cl2", ".cljc", ".cljs", ".cljs.hl", ".cljscm", ".cljx", ".hic"},
"Closure Templates": {".soy"}, "Closure Templates": {".soy"},
"CoNLL-U": {".conllu", ".conll"}, "CoNLL-U": {".conllu", ".conll"},
"CodeQL": {".ql", ".qll"}, "CodeQL": {".ql", ".qll"},
@ -1411,7 +1449,7 @@ var ExtensionsByLanguage = map[string][]string{
"Erlang": {".erl", ".app.src", ".es", ".escript", ".hrl", ".xrl", ".yrl"}, "Erlang": {".erl", ".app.src", ".es", ".escript", ".hrl", ".xrl", ".yrl"},
"Euphoria": {".e", ".ex"}, "Euphoria": {".e", ".ex"},
"F#": {".fs", ".fsi", ".fsx"}, "F#": {".fs", ".fsi", ".fsx"},
"F*": {".fst"}, "F*": {".fst", ".fsti"},
"FIGlet Font": {".flf"}, "FIGlet Font": {".flf"},
"FLUX": {".fx", ".flux"}, "FLUX": {".fx", ".flux"},
"Factor": {".factor"}, "Factor": {".factor"},
@ -1502,7 +1540,7 @@ var ExtensionsByLanguage = map[string][]string{
"Isabelle": {".thy"}, "Isabelle": {".thy"},
"J": {".ijs"}, "J": {".ijs"},
"JFlex": {".flex", ".jflex"}, "JFlex": {".flex", ".jflex"},
"JSON": {".json", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".json-tmlanguage", ".jsonl", ".mcmeta", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"}, "JSON": {".json", ".4dform", ".4dproject", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".json-tmlanguage", ".jsonl", ".mcmeta", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"},
"JSON with Comments": {".jsonc", ".code-snippets", ".sublime-build", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"}, "JSON with Comments": {".jsonc", ".code-snippets", ".sublime-build", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"},
"JSON5": {".json5"}, "JSON5": {".json5"},
"JSONLD": {".jsonld"}, "JSONLD": {".jsonld"},
@ -1515,6 +1553,7 @@ var ExtensionsByLanguage = map[string][]string{
"JavaScript": {".js", "._js", ".bones", ".cjs", ".es", ".es6", ".frag", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".jsx", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib"}, "JavaScript": {".js", "._js", ".bones", ".cjs", ".es", ".es6", ".frag", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".jsx", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib"},
"JavaScript+ERB": {".js.erb"}, "JavaScript+ERB": {".js.erb"},
"Jest Snapshot": {".snap"}, "Jest Snapshot": {".snap"},
"JetBrains MPS": {".mps", ".mpl", ".msd"},
"Jinja": {".jinja", ".j2", ".jinja2"}, "Jinja": {".jinja", ".j2", ".jinja2"},
"Jison": {".jison"}, "Jison": {".jison"},
"Jison Lex": {".jisonlex"}, "Jison Lex": {".jisonlex"},
@ -1527,7 +1566,7 @@ var ExtensionsByLanguage = map[string][]string{
"KakouneScript": {".kak"}, "KakouneScript": {".kak"},
"KiCad Layout": {".kicad_pcb", ".kicad_mod", ".kicad_wks"}, "KiCad Layout": {".kicad_pcb", ".kicad_mod", ".kicad_wks"},
"KiCad Legacy Layout": {".brd"}, "KiCad Legacy Layout": {".brd"},
"KiCad Schematic": {".sch"}, "KiCad Schematic": {".kicad_sch", ".sch"},
"Kit": {".kit"}, "Kit": {".kit"},
"Kotlin": {".kt", ".ktm", ".kts"}, "Kotlin": {".kt", ".ktm", ".kts"},
"Kusto": {".csl"}, "Kusto": {".csl"},
@ -1536,7 +1575,7 @@ var ExtensionsByLanguage = map[string][]string{
"LOLCODE": {".lol"}, "LOLCODE": {".lol"},
"LSL": {".lsl", ".lslp"}, "LSL": {".lsl", ".lslp"},
"LTspice Symbol": {".asy"}, "LTspice Symbol": {".asy"},
"LabVIEW": {".lvproj", ".lvlib"}, "LabVIEW": {".lvproj", ".lvclass", ".lvlib"},
"Lark": {".lark"}, "Lark": {".lark"},
"Lasso": {".lasso", ".las", ".lasso8", ".lasso9"}, "Lasso": {".lasso", ".las", ".lasso8", ".lasso9"},
"Latte": {".latte"}, "Latte": {".latte"},
@ -1571,7 +1610,7 @@ var ExtensionsByLanguage = map[string][]string{
"Macaulay2": {".m2"}, "Macaulay2": {".m2"},
"Makefile": {".mak", ".d", ".make", ".makefile", ".mk", ".mkfile"}, "Makefile": {".mak", ".d", ".make", ".makefile", ".mk", ".mkfile"},
"Mako": {".mako", ".mao"}, "Mako": {".mako", ".mao"},
"Markdown": {".md", ".markdown", ".mdown", ".mdwn", ".mdx", ".mkd", ".mkdn", ".mkdown", ".ronn", ".scd", ".workbook"}, "Markdown": {".md", ".livemd", ".markdown", ".mdown", ".mdwn", ".mdx", ".mkd", ".mkdn", ".mkdown", ".ronn", ".scd", ".workbook"},
"Marko": {".marko"}, "Marko": {".marko"},
"Mask": {".mask"}, "Mask": {".mask"},
"Mathematica": {".mathematica", ".cdf", ".m", ".ma", ".mt", ".nb", ".nbp", ".wl", ".wlt"}, "Mathematica": {".mathematica", ".cdf", ".m", ".ma", ".mt", ".nb", ".nbp", ".wl", ".wlt"},
@ -1665,6 +1704,7 @@ var ExtensionsByLanguage = map[string][]string{
"Pod 6": {".pod", ".pod6"}, "Pod 6": {".pod", ".pod6"},
"PogoScript": {".pogo"}, "PogoScript": {".pogo"},
"Pony": {".pony"}, "Pony": {".pony"},
"Portugol": {".por"},
"PostCSS": {".pcss", ".postcss"}, "PostCSS": {".pcss", ".postcss"},
"PostScript": {".ps", ".eps", ".epsi", ".pfa"}, "PostScript": {".ps", ".eps", ".epsi", ".pfa"},
"PowerBuilder": {".pbt", ".sra", ".sru", ".srw"}, "PowerBuilder": {".pbt", ".sra", ".sru", ".srw"},
@ -1731,6 +1771,8 @@ var ExtensionsByLanguage = map[string][]string{
"SQL": {".sql", ".cql", ".ddl", ".inc", ".mysql", ".prc", ".tab", ".udf", ".viw"}, "SQL": {".sql", ".cql", ".ddl", ".inc", ".mysql", ".prc", ".tab", ".udf", ".viw"},
"SQLPL": {".sql", ".db2"}, "SQLPL": {".sql", ".db2"},
"SRecode Template": {".srt"}, "SRecode Template": {".srt"},
"STAR": {".star"},
"STL": {".stl"},
"STON": {".ston"}, "STON": {".ston"},
"SVG": {".svg"}, "SVG": {".svg"},
"SWIG": {".i"}, "SWIG": {".i"},
@ -1760,7 +1802,7 @@ var ExtensionsByLanguage = map[string][]string{
"Squirrel": {".nut"}, "Squirrel": {".nut"},
"Stan": {".stan"}, "Stan": {".stan"},
"Standard ML": {".ml", ".fun", ".sig", ".sml"}, "Standard ML": {".ml", ".fun", ".sig", ".sml"},
"Starlark": {".bzl"}, "Starlark": {".bzl", ".star"},
"Stata": {".do", ".ado", ".doh", ".ihlp", ".mata", ".matah", ".sthlp"}, "Stata": {".do", ".ado", ".doh", ".ihlp", ".mata", ".matah", ".sthlp"},
"StringTemplate": {".st"}, "StringTemplate": {".st"},
"Stylus": {".styl"}, "Stylus": {".styl"},
@ -1791,7 +1833,7 @@ var ExtensionsByLanguage = map[string][]string{
"Turtle": {".ttl"}, "Turtle": {".ttl"},
"Twig": {".twig"}, "Twig": {".twig"},
"Type Language": {".tl"}, "Type Language": {".tl"},
"TypeScript": {".ts"}, "TypeScript": {".ts", ".cts", ".mts"},
"Unified Parallel C": {".upc"}, "Unified Parallel C": {".upc"},
"Unity3D Asset": {".anim", ".asset", ".mask", ".mat", ".meta", ".prefab", ".unity"}, "Unity3D Asset": {".anim", ".asset", ".mask", ".mat", ".meta", ".prefab", ".unity"},
"Unix Assembly": {".s", ".ms"}, "Unix Assembly": {".s", ".ms"},
@ -1819,6 +1861,7 @@ var ExtensionsByLanguage = map[string][]string{
"WebAssembly": {".wast", ".wat"}, "WebAssembly": {".wast", ".wat"},
"WebIDL": {".webidl"}, "WebIDL": {".webidl"},
"WebVTT": {".vtt"}, "WebVTT": {".vtt"},
"Whiley": {".whiley"},
"Wikitext": {".mediawiki", ".wiki", ".wikitext"}, "Wikitext": {".mediawiki", ".wiki", ".wikitext"},
"Win32 Message File": {".mc"}, "Win32 Message File": {".mc"},
"Windows Registry Entries": {".reg"}, "Windows Registry Entries": {".reg"},
@ -1844,6 +1887,7 @@ var ExtensionsByLanguage = map[string][]string{
"YARA": {".yar", ".yara"}, "YARA": {".yar", ".yara"},
"YASnippet": {".yasnippet"}, "YASnippet": {".yasnippet"},
"Yacc": {".y", ".yacc", ".yy"}, "Yacc": {".y", ".yacc", ".yy"},
"Yul": {".yul"},
"ZAP": {".zap", ".xzap"}, "ZAP": {".zap", ".xzap"},
"ZIL": {".zil", ".mud"}, "ZIL": {".zil", ".mud"},
"Zeek": {".zeek", ".bro"}, "Zeek": {".zeek", ".bro"},

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -24,10 +24,12 @@ var LanguagesByFilename = map[string][]string{
".clang-tidy": {"YAML"}, ".clang-tidy": {"YAML"},
".classpath": {"XML"}, ".classpath": {"XML"},
".coffeelintignore": {"Ignore List"}, ".coffeelintignore": {"Ignore List"},
".coveragerc": {"INI"},
".cproject": {"XML"}, ".cproject": {"XML"},
".cshrc": {"Shell"}, ".cshrc": {"Shell"},
".curlrc": {"cURL Config"}, ".curlrc": {"cURL Config"},
".cvsignore": {"Ignore List"}, ".cvsignore": {"Ignore List"},
".devcontainer.json": {"JSON with Comments"},
".dir_colors": {"dircolors"}, ".dir_colors": {"dircolors"},
".dircolors": {"dircolors"}, ".dircolors": {"dircolors"},
".dockerignore": {"Ignore List"}, ".dockerignore": {"Ignore List"},
@ -46,6 +48,7 @@ var LanguagesByFilename = map[string][]string{
".flaskenv": {"Shell"}, ".flaskenv": {"Shell"},
".gclient": {"Python"}, ".gclient": {"Python"},
".gemrc": {"YAML"}, ".gemrc": {"YAML"},
".git-blame-ignore-revs": {"Git Revision List"},
".gitattributes": {"Git Attributes"}, ".gitattributes": {"Git Attributes"},
".gitconfig": {"Git Config"}, ".gitconfig": {"Git Config"},
".gitignore": {"Ignore List"}, ".gitignore": {"Ignore List"},
@ -78,6 +81,7 @@ var LanguagesByFilename = map[string][]string{
".profile": {"Shell"}, ".profile": {"Shell"},
".project": {"XML"}, ".project": {"XML"},
".pryrc": {"Ruby"}, ".pryrc": {"Ruby"},
".pylintrc": {"INI"},
".shellcheckrc": {"ShellCheck Config"}, ".shellcheckrc": {"ShellCheck Config"},
".simplecov": {"Ruby"}, ".simplecov": {"Ruby"},
".spacemacs": {"Emacs Lisp"}, ".spacemacs": {"Emacs Lisp"},
@ -146,6 +150,7 @@ var LanguagesByFilename = map[string][]string{
"LICENSE.mysql": {"Text"}, "LICENSE.mysql": {"Text"},
"Lexer.x": {"Lex"}, "Lexer.x": {"Lex"},
"MANIFEST.MF": {"JAR Manifest"}, "MANIFEST.MF": {"JAR Manifest"},
"MD5SUMS": {"Checksums"},
"Makefile": {"Makefile"}, "Makefile": {"Makefile"},
"Makefile.PL": {"Perl"}, "Makefile.PL": {"Perl"},
"Makefile.am": {"Makefile"}, "Makefile.am": {"Makefile"},
@ -176,6 +181,10 @@ var LanguagesByFilename = map[string][]string{
"Rexfile": {"Perl"}, "Rexfile": {"Perl"},
"SConscript": {"Python"}, "SConscript": {"Python"},
"SConstruct": {"Python"}, "SConstruct": {"Python"},
"SHA1SUMS": {"Checksums"},
"SHA256SUMS": {"Checksums"},
"SHA256SUMS.txt": {"Checksums"},
"SHA512SUMS": {"Checksums"},
"Settings.StyleCop": {"XML"}, "Settings.StyleCop": {"XML"},
"Singularity": {"Singularity"}, "Singularity": {"Singularity"},
"Slakefile": {"LiveScript"}, "Slakefile": {"LiveScript"},
@ -211,6 +220,8 @@ var LanguagesByFilename = map[string][]string{
"buildozer.spec": {"INI"}, "buildozer.spec": {"INI"},
"cabal.config": {"Cabal Config"}, "cabal.config": {"Cabal Config"},
"cabal.project": {"Cabal Config"}, "cabal.project": {"Cabal Config"},
"checksums.txt": {"Checksums"},
"cksums": {"Checksums"},
"click.me": {"Text"}, "click.me": {"Text"},
"composer.lock": {"JSON"}, "composer.lock": {"JSON"},
"configure.ac": {"M4Sugar"}, "configure.ac": {"M4Sugar"},
@ -259,6 +270,7 @@ var LanguagesByFilename = map[string][]string{
"makefile.sco": {"Makefile"}, "makefile.sco": {"Makefile"},
"man": {"Shell"}, "man": {"Shell"},
"mcmod.info": {"JSON"}, "mcmod.info": {"JSON"},
"md5sum.txt": {"Checksums"},
"meson.build": {"Meson"}, "meson.build": {"Meson"},
"meson_options.txt": {"Meson"}, "meson_options.txt": {"Meson"},
"mix.lock": {"Elixir"}, "mix.lock": {"Elixir"},
@ -279,6 +291,7 @@ var LanguagesByFilename = map[string][]string{
"pom.xml": {"Maven POM"}, "pom.xml": {"Maven POM"},
"port_contexts": {"SELinux Policy"}, "port_contexts": {"SELinux Policy"},
"profile": {"Shell"}, "profile": {"Shell"},
"pylintrc": {"INI"},
"read.me": {"Text"}, "read.me": {"Text"},
"readme.1st": {"Text"}, "readme.1st": {"Text"},
"rebar.config": {"Erlang"}, "rebar.config": {"Erlang"},

File diff suppressed because it is too large Load Diff

View File

@ -74,7 +74,7 @@ var GeneratedCodeNameMatchers = []GeneratedCodeNameMatcher{
nameEndsWith("package-lock.json"), nameEndsWith("package-lock.json"),
// Yarn plugnplay // Yarn plugnplay
nameMatches(`(^|\/)\.pnp\.(c|m)?js$`), nameMatches(`(^|\/)\.pnp\..*$`),
// Godeps // Godeps
nameContains("Godeps/"), nameContains("Godeps/"),
@ -113,6 +113,7 @@ var GeneratedCodeMatchers = []GeneratedCodeMatcher{
isGeneratedJavaScriptPEGParser, isGeneratedJavaScriptPEGParser,
isGeneratedPostScript, isGeneratedPostScript,
isGeneratedGo, isGeneratedGo,
isGeneratedProtobufFromGo,
isGeneratedProtobuf, isGeneratedProtobuf,
isGeneratedJavaScriptProtocolBuffer, isGeneratedJavaScriptProtocolBuffer,
isGeneratedApacheThrift, isGeneratedApacheThrift,
@ -339,6 +340,24 @@ func isGeneratedGo(_, ext string, content []byte) bool {
return false return false
} }
func isGeneratedProtobufFromGo(_, ext string, content []byte) bool {
if ext != ".proto" {
return false
}
lines := getLines(content, 20)
if len(lines) <= 1 {
return false
}
for _, line := range lines {
if bytes.Contains(line, []byte("This file was autogenerated by go-to-protobuf")) {
return true
}
}
return false
}
var protoExtensions = map[string]struct{}{ var protoExtensions = map[string]struct{}{
".py": {}, ".py": {},
".java": {}, ".java": {},

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -30,6 +30,7 @@ var IDByLanguage = map[string]int{
"Altium Designer": 187772328, "Altium Designer": 187772328,
"AngelScript": 389477596, "AngelScript": 389477596,
"Ant Build System": 15, "Ant Build System": 15,
"Antlers": 1067292663,
"ApacheConf": 16, "ApacheConf": 16,
"Apex": 17, "Apex": 17,
"Apollo Guidance Computer": 18, "Apollo Guidance Computer": 18,
@ -53,6 +54,7 @@ var IDByLanguage = map[string]int{
"Berry": 121855308, "Berry": 121855308,
"BibTeX": 982188347, "BibTeX": 982188347,
"Bicep": 321200902, "Bicep": 321200902,
"Bikeshed": 1055528081,
"Bison": 31, "Bison": 31,
"BitBake": 32, "BitBake": 32,
"Blade": 33, "Blade": 33,
@ -62,6 +64,7 @@ var IDByLanguage = map[string]int{
"Boo": 37, "Boo": 37,
"Boogie": 955017407, "Boogie": 955017407,
"Brainfuck": 38, "Brainfuck": 38,
"BrighterScript": 943571030,
"Brightscript": 39, "Brightscript": 39,
"Browserslist": 153503348, "Browserslist": 153503348,
"C": 41, "C": 41,
@ -69,6 +72,7 @@ var IDByLanguage = map[string]int{
"C++": 43, "C++": 43,
"C-ObjDump": 44, "C-ObjDump": 44,
"C2hs Haskell": 45, "C2hs Haskell": 45,
"CAP CDS": 390788699,
"CIL": 29176339, "CIL": 29176339,
"CLIPS": 46, "CLIPS": 46,
"CMake": 47, "CMake": 47,
@ -89,6 +93,7 @@ var IDByLanguage = map[string]int{
"Ceylon": 54, "Ceylon": 54,
"Chapel": 55, "Chapel": 55,
"Charity": 56, "Charity": 56,
"Checksums": 372063053,
"ChucK": 57, "ChucK": 57,
"Cirru": 58, "Cirru": 58,
"Clarion": 59, "Clarion": 59,
@ -202,6 +207,7 @@ var IDByLanguage = map[string]int{
"Gherkin": 76, "Gherkin": 76,
"Git Attributes": 956324166, "Git Attributes": 956324166,
"Git Config": 807968997, "Git Config": 807968997,
"Git Revision List": 461881235,
"Gleam": 1054258749, "Gleam": 1054258749,
"Glyph": 130, "Glyph": 130,
"Glyph Bitmap Distribution Format": 997665271, "Glyph Bitmap Distribution Format": 997665271,
@ -269,6 +275,7 @@ var IDByLanguage = map[string]int{
"JavaScript": 183, "JavaScript": 183,
"JavaScript+ERB": 914318960, "JavaScript+ERB": 914318960,
"Jest Snapshot": 774635084, "Jest Snapshot": 774635084,
"JetBrains MPS": 465165328,
"Jinja": 147, "Jinja": 147,
"Jison": 284531423, "Jison": 284531423,
"Jison Lex": 406395330, "Jison Lex": 406395330,
@ -423,6 +430,7 @@ var IDByLanguage = map[string]int{
"Pod 6": 155357471, "Pod 6": 155357471,
"PogoScript": 289, "PogoScript": 289,
"Pony": 290, "Pony": 290,
"Portugol": 832391833,
"PostCSS": 262764437, "PostCSS": 262764437,
"PostScript": 291, "PostScript": 291,
"PowerBuilder": 292, "PowerBuilder": 292,
@ -496,6 +504,8 @@ var IDByLanguage = map[string]int{
"SQLPL": 334, "SQLPL": 334,
"SRecode Template": 335, "SRecode Template": 335,
"SSH Config": 554920715, "SSH Config": 554920715,
"STAR": 424510560,
"STL": 455361735,
"STON": 336, "STON": 336,
"SVG": 337, "SVG": 337,
"SWIG": 1066250075, "SWIG": 1066250075,
@ -589,6 +599,7 @@ var IDByLanguage = map[string]int{
"WebIDL": 395, "WebIDL": 395,
"WebVTT": 658679714, "WebVTT": 658679714,
"Wget Config": 668457123, "Wget Config": 668457123,
"Whiley": 888779559,
"Wikitext": 228, "Wikitext": 228,
"Win32 Message File": 950967261, "Win32 Message File": 950967261,
"Windows Registry Entries": 969674868, "Windows Registry Entries": 969674868,
@ -616,6 +627,7 @@ var IDByLanguage = map[string]int{
"YARA": 805122868, "YARA": 805122868,
"YASnippet": 378760102, "YASnippet": 378760102,
"Yacc": 409, "Yacc": 409,
"Yul": 237469033,
"ZAP": 952972794, "ZAP": 952972794,
"ZIL": 973483626, "ZIL": 973483626,
"Zeek": 40, "Zeek": 40,

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -13,6 +13,7 @@ var LanguagesByInterpreter = map[string][]string{
"asy": {"Asymptote"}, "asy": {"Asymptote"},
"awk": {"Awk"}, "awk": {"Awk"},
"bash": {"Shell"}, "bash": {"Shell"},
"bb": {"Clojure"},
"bigloo": {"Scheme"}, "bigloo": {"Scheme"},
"boogie": {"Boogie"}, "boogie": {"Boogie"},
"boolector": {"SMT"}, "boolector": {"SMT"},

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -584,6 +584,27 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 15, LanguageID: 15,
}, },
1067292663: LanguageInfo{
Name: "Antlers",
FSName: "",
Type: TypeForString("markup"),
Color: "#ff269e",
Group: "",
Aliases: []string{},
Extensions: []string{
".antlers.html",
".antlers.php",
".antlers.xml",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "text.html.statamic",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 1067292663,
},
16: LanguageInfo{ 16: LanguageInfo{
Name: "ApacheConf", Name: "ApacheConf",
FSName: "", FSName: "",
@ -1070,6 +1091,25 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 321200902, LanguageID: 321200902,
}, },
1055528081: LanguageInfo{
Name: "Bikeshed",
FSName: "",
Type: TypeForString("markup"),
Color: "#5562ac",
Group: "",
Aliases: []string{},
Extensions: []string{
".bs",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "text/html",
TMScope: "source.csswg",
AceMode: "html",
CodeMirrorMode: "htmlmixed",
Wrap: false,
LanguageID: 1055528081,
},
31: LanguageInfo{ 31: LanguageInfo{
Name: "Bison", Name: "Bison",
FSName: "", FSName: "",
@ -1253,6 +1293,25 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 38, LanguageID: 38,
}, },
943571030: LanguageInfo{
Name: "BrighterScript",
FSName: "",
Type: TypeForString("programming"),
Color: "#66AABB",
Group: "",
Aliases: []string{},
Extensions: []string{
".bs",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "source.brs",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 943571030,
},
39: LanguageInfo{ 39: LanguageInfo{
Name: "Brightscript", Name: "Brightscript",
FSName: "", FSName: "",
@ -1266,7 +1325,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
Interpreters: []string{}, Interpreters: []string{},
Filenames: []string{}, Filenames: []string{},
MimeType: "", MimeType: "",
TMScope: "source.brightscript", TMScope: "source.brs",
AceMode: "text", AceMode: "text",
CodeMirrorMode: "", CodeMirrorMode: "",
Wrap: false, Wrap: false,
@ -1420,6 +1479,27 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 45, LanguageID: 45,
}, },
390788699: LanguageInfo{
Name: "CAP CDS",
FSName: "",
Type: TypeForString("programming"),
Color: "#0092d1",
Group: "",
Aliases: []string{
"cds",
},
Extensions: []string{
".cds",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "source.cds",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 390788699,
},
29176339: LanguageInfo{ 29176339: LanguageInfo{
Name: "CIL", Name: "CIL",
FSName: "", FSName: "",
@ -1816,6 +1896,51 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 56, LanguageID: 56,
}, },
372063053: LanguageInfo{
Name: "Checksums",
FSName: "",
Type: TypeForString("data"),
Color: "",
Group: "",
Aliases: []string{
"checksum",
"hash",
"hashes",
"sum",
"sums",
},
Extensions: []string{
".crc32",
".md2",
".md4",
".md5",
".sha1",
".sha2",
".sha224",
".sha256",
".sha256sum",
".sha3",
".sha384",
".sha512",
},
Interpreters: []string{},
Filenames: []string{
"MD5SUMS",
"SHA1SUMS",
"SHA256SUMS",
"SHA256SUMS.txt",
"SHA512SUMS",
"checksums.txt",
"cksums",
"md5sum.txt",
},
MimeType: "",
TMScope: "text.checksums",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 372063053,
},
57: LanguageInfo{ 57: LanguageInfo{
Name: "ChucK", Name: "ChucK",
FSName: "", FSName: "",
@ -1961,6 +2086,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
Aliases: []string{}, Aliases: []string{},
Extensions: []string{ Extensions: []string{
".clj", ".clj",
".bb",
".boot", ".boot",
".cl2", ".cl2",
".cljc", ".cljc",
@ -1970,7 +2096,9 @@ var LanguageInfoByID = map[int]LanguageInfo{
".cljx", ".cljx",
".hic", ".hic",
}, },
Interpreters: []string{}, Interpreters: []string{
"bb",
},
Filenames: []string{ Filenames: []string{
"riemann.config", "riemann.config",
}, },
@ -3328,6 +3456,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
}, },
Extensions: []string{ Extensions: []string{
".fst", ".fst",
".fsti",
}, },
Interpreters: []string{}, Interpreters: []string{},
Filenames: []string{}, Filenames: []string{},
@ -4239,6 +4368,27 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 807968997, LanguageID: 807968997,
}, },
461881235: LanguageInfo{
Name: "Git Revision List",
FSName: "",
Type: TypeForString("data"),
Color: "#F44D27",
Group: "",
Aliases: []string{
"Git Blame Ignore Revs",
},
Extensions: []string{},
Interpreters: []string{},
Filenames: []string{
".git-blame-ignore-revs",
},
MimeType: "",
TMScope: "source.git-revlist",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 461881235,
},
1054258749: LanguageInfo{ 1054258749: LanguageInfo{
Name: "Gleam", Name: "Gleam",
FSName: "", FSName: "",
@ -5115,8 +5265,11 @@ var LanguageInfoByID = map[int]LanguageInfo{
}, },
Interpreters: []string{}, Interpreters: []string{},
Filenames: []string{ Filenames: []string{
".coveragerc",
".flake8", ".flake8",
".pylintrc",
"buildozer.spec", "buildozer.spec",
"pylintrc",
}, },
MimeType: "text/x-properties", MimeType: "text/x-properties",
TMScope: "source.ini", TMScope: "source.ini",
@ -5415,14 +5568,20 @@ var LanguageInfoByID = map[int]LanguageInfo{
LanguageID: 173, LanguageID: 173,
}, },
174: LanguageInfo{ 174: LanguageInfo{
Name: "JSON", Name: "JSON",
FSName: "", FSName: "",
Type: TypeForString("data"), Type: TypeForString("data"),
Color: "#292929", Color: "#292929",
Group: "", Group: "",
Aliases: []string{}, Aliases: []string{
"geojson",
"jsonl",
"topojson",
},
Extensions: []string{ Extensions: []string{
".json", ".json",
".4DForm",
".4DProject",
".avsc", ".avsc",
".geojson", ".geojson",
".gltf", ".gltf",
@ -5490,6 +5649,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
Interpreters: []string{}, Interpreters: []string{},
Filenames: []string{ Filenames: []string{
".babelrc", ".babelrc",
".devcontainer.json",
".eslintrc.json", ".eslintrc.json",
".jscsrc", ".jscsrc",
".jshintrc", ".jshintrc",
@ -5762,6 +5922,29 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 774635084, LanguageID: 774635084,
}, },
465165328: LanguageInfo{
Name: "JetBrains MPS",
FSName: "",
Type: TypeForString("programming"),
Color: "#21D789",
Group: "",
Aliases: []string{
"mps",
},
Extensions: []string{
".mps",
".mpl",
".msd",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "text/xml",
TMScope: "none",
AceMode: "xml",
CodeMirrorMode: "xml",
Wrap: false,
LanguageID: 465165328,
},
147: LanguageInfo{ 147: LanguageInfo{
Name: "Jinja", Name: "Jinja",
FSName: "", FSName: "",
@ -6030,6 +6213,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
"eeschema schematic", "eeschema schematic",
}, },
Extensions: []string{ Extensions: []string{
".kicad_sch",
".sch", ".sch",
}, },
Interpreters: []string{}, Interpreters: []string{},
@ -6207,6 +6391,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
Aliases: []string{}, Aliases: []string{},
Extensions: []string{ Extensions: []string{
".lvproj", ".lvproj",
".lvclass",
".lvlib", ".lvlib",
}, },
Interpreters: []string{}, Interpreters: []string{},
@ -6968,6 +7153,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
}, },
Extensions: []string{ Extensions: []string{
".md", ".md",
".livemd",
".markdown", ".markdown",
".mdown", ".mdown",
".mdwn", ".mdwn",
@ -9056,6 +9242,25 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 290, LanguageID: 290,
}, },
832391833: LanguageInfo{
Name: "Portugol",
FSName: "",
Type: TypeForString("programming"),
Color: "#f8bd00",
Group: "",
Aliases: []string{},
Extensions: []string{
".por",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "source.portugol",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 832391833,
},
262764437: LanguageInfo{ 262764437: LanguageInfo{
Name: "PostCSS", Name: "PostCSS",
FSName: "", FSName: "",
@ -10764,6 +10969,47 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 554920715, LanguageID: 554920715,
}, },
424510560: LanguageInfo{
Name: "STAR",
FSName: "",
Type: TypeForString("data"),
Color: "",
Group: "",
Aliases: []string{},
Extensions: []string{
".star",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "source.star",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 424510560,
},
455361735: LanguageInfo{
Name: "STL",
FSName: "",
Type: TypeForString("data"),
Color: "#373b5e",
Group: "",
Aliases: []string{
"ascii stl",
"stla",
},
Extensions: []string{
".stl",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "source.stl",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 455361735,
},
336: LanguageInfo{ 336: LanguageInfo{
Name: "STON", Name: "STON",
FSName: "", FSName: "",
@ -11488,6 +11734,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
}, },
Extensions: []string{ Extensions: []string{
".bzl", ".bzl",
".star",
}, },
Interpreters: []string{}, Interpreters: []string{},
Filenames: []string{ Filenames: []string{
@ -11794,7 +12041,7 @@ var LanguageInfoByID = map[int]LanguageInfo{
Name: "TSX", Name: "TSX",
FSName: "", FSName: "",
Type: TypeForString("programming"), Type: TypeForString("programming"),
Color: "#2b7489", Color: "#3178c6",
Group: "TypeScript", Group: "TypeScript",
Aliases: []string{}, Aliases: []string{},
Extensions: []string{ Extensions: []string{
@ -12189,13 +12436,15 @@ var LanguageInfoByID = map[int]LanguageInfo{
Name: "TypeScript", Name: "TypeScript",
FSName: "", FSName: "",
Type: TypeForString("programming"), Type: TypeForString("programming"),
Color: "#2b7489", Color: "#3178c6",
Group: "", Group: "",
Aliases: []string{ Aliases: []string{
"ts", "ts",
}, },
Extensions: []string{ Extensions: []string{
".ts", ".ts",
".cts",
".mts",
}, },
Interpreters: []string{ Interpreters: []string{
"deno", "deno",
@ -12254,12 +12503,16 @@ var LanguageInfoByID = map[int]LanguageInfo{
LanguageID: 380, LanguageID: 380,
}, },
120: LanguageInfo{ 120: LanguageInfo{
Name: "Unix Assembly", Name: "Unix Assembly",
FSName: "", FSName: "",
Type: TypeForString("programming"), Type: TypeForString("programming"),
Color: "", Color: "",
Group: "Assembly", Group: "Assembly",
Aliases: []string{}, Aliases: []string{
"gas",
"gnu asm",
"unix asm",
},
Extensions: []string{ Extensions: []string{
".s", ".s",
".ms", ".ms",
@ -12773,19 +13026,21 @@ var LanguageInfoByID = map[int]LanguageInfo{
LanguageID: 395, LanguageID: 395,
}, },
658679714: LanguageInfo{ 658679714: LanguageInfo{
Name: "WebVTT", Name: "WebVTT",
FSName: "", FSName: "",
Type: TypeForString("data"), Type: TypeForString("data"),
Color: "", Color: "",
Group: "", Group: "",
Aliases: []string{}, Aliases: []string{
"vtt",
},
Extensions: []string{ Extensions: []string{
".vtt", ".vtt",
}, },
Interpreters: []string{}, Interpreters: []string{},
Filenames: []string{}, Filenames: []string{},
MimeType: "", MimeType: "",
TMScope: "source.vtt", TMScope: "text.vtt",
AceMode: "text", AceMode: "text",
CodeMirrorMode: "", CodeMirrorMode: "",
Wrap: true, Wrap: true,
@ -12812,6 +13067,25 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 668457123, LanguageID: 668457123,
}, },
888779559: LanguageInfo{
Name: "Whiley",
FSName: "",
Type: TypeForString("programming"),
Color: "#d5c397",
Group: "",
Aliases: []string{},
Extensions: []string{
".whiley",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "source.whiley",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 888779559,
},
228: LanguageInfo{ 228: LanguageInfo{
Name: "Wikitext", Name: "Wikitext",
FSName: "", FSName: "",
@ -13502,6 +13776,25 @@ var LanguageInfoByID = map[int]LanguageInfo{
Wrap: false, Wrap: false,
LanguageID: 409, LanguageID: 409,
}, },
237469033: LanguageInfo{
Name: "Yul",
FSName: "",
Type: TypeForString("programming"),
Color: "#794932",
Group: "",
Aliases: []string{},
Extensions: []string{
".yul",
},
Interpreters: []string{},
Filenames: []string{},
MimeType: "",
TMScope: "source.yul",
AceMode: "text",
CodeMirrorMode: "",
Wrap: false,
LanguageID: 237469033,
},
952972794: LanguageInfo{ 952972794: LanguageInfo{
Name: "ZAP", Name: "ZAP",
FSName: "", FSName: "",

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -16,6 +16,7 @@ var LanguagesMime = map[string]string{
"Asymptote": "text/x-kotlin", "Asymptote": "text/x-kotlin",
"Beef": "text/x-csharp", "Beef": "text/x-csharp",
"BibTeX": "text/x-stex", "BibTeX": "text/x-stex",
"Bikeshed": "text/html",
"Brainfuck": "text/x-brainfuck", "Brainfuck": "text/x-brainfuck",
"C": "text/x-csrc", "C": "text/x-csrc",
"C#": "text/x-csharp", "C#": "text/x-csharp",
@ -111,6 +112,7 @@ var LanguagesMime = map[string]string{
"JavaScript": "text/javascript", "JavaScript": "text/javascript",
"JavaScript+ERB": "application/javascript", "JavaScript+ERB": "application/javascript",
"Jest Snapshot": "application/javascript", "Jest Snapshot": "application/javascript",
"JetBrains MPS": "text/xml",
"Jinja": "text/x-django", "Jinja": "text/x-django",
"Julia": "text/x-julia", "Julia": "text/x-julia",
"Jupyter Notebook": "application/json", "Jupyter Notebook": "application/json",

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -72,6 +72,7 @@ var LanguagesType = map[string]int{
"Altium Designer": 1, "Altium Designer": 1,
"AngelScript": 2, "AngelScript": 2,
"Ant Build System": 1, "Ant Build System": 1,
"Antlers": 3,
"ApacheConf": 1, "ApacheConf": 1,
"Apex": 2, "Apex": 2,
"Apollo Guidance Computer": 2, "Apollo Guidance Computer": 2,
@ -95,6 +96,7 @@ var LanguagesType = map[string]int{
"Berry": 2, "Berry": 2,
"BibTeX": 3, "BibTeX": 3,
"Bicep": 2, "Bicep": 2,
"Bikeshed": 3,
"Bison": 2, "Bison": 2,
"BitBake": 2, "BitBake": 2,
"Blade": 3, "Blade": 3,
@ -104,6 +106,7 @@ var LanguagesType = map[string]int{
"Boo": 2, "Boo": 2,
"Boogie": 2, "Boogie": 2,
"Brainfuck": 2, "Brainfuck": 2,
"BrighterScript": 2,
"Brightscript": 2, "Brightscript": 2,
"Browserslist": 1, "Browserslist": 1,
"C": 2, "C": 2,
@ -111,6 +114,7 @@ var LanguagesType = map[string]int{
"C++": 2, "C++": 2,
"C-ObjDump": 1, "C-ObjDump": 1,
"C2hs Haskell": 2, "C2hs Haskell": 2,
"CAP CDS": 2,
"CIL": 1, "CIL": 1,
"CLIPS": 2, "CLIPS": 2,
"CMake": 2, "CMake": 2,
@ -131,6 +135,7 @@ var LanguagesType = map[string]int{
"Ceylon": 2, "Ceylon": 2,
"Chapel": 2, "Chapel": 2,
"Charity": 2, "Charity": 2,
"Checksums": 1,
"ChucK": 2, "ChucK": 2,
"Cirru": 2, "Cirru": 2,
"Clarion": 2, "Clarion": 2,
@ -244,6 +249,7 @@ var LanguagesType = map[string]int{
"Gherkin": 2, "Gherkin": 2,
"Git Attributes": 1, "Git Attributes": 1,
"Git Config": 1, "Git Config": 1,
"Git Revision List": 1,
"Gleam": 2, "Gleam": 2,
"Glyph": 2, "Glyph": 2,
"Glyph Bitmap Distribution Format": 1, "Glyph Bitmap Distribution Format": 1,
@ -311,6 +317,7 @@ var LanguagesType = map[string]int{
"JavaScript": 2, "JavaScript": 2,
"JavaScript+ERB": 2, "JavaScript+ERB": 2,
"Jest Snapshot": 1, "Jest Snapshot": 1,
"JetBrains MPS": 2,
"Jinja": 3, "Jinja": 3,
"Jison": 2, "Jison": 2,
"Jison Lex": 2, "Jison Lex": 2,
@ -465,6 +472,7 @@ var LanguagesType = map[string]int{
"Pod 6": 4, "Pod 6": 4,
"PogoScript": 2, "PogoScript": 2,
"Pony": 2, "Pony": 2,
"Portugol": 2,
"PostCSS": 3, "PostCSS": 3,
"PostScript": 3, "PostScript": 3,
"PowerBuilder": 2, "PowerBuilder": 2,
@ -538,6 +546,8 @@ var LanguagesType = map[string]int{
"SQLPL": 2, "SQLPL": 2,
"SRecode Template": 3, "SRecode Template": 3,
"SSH Config": 1, "SSH Config": 1,
"STAR": 1,
"STL": 1,
"STON": 1, "STON": 1,
"SVG": 1, "SVG": 1,
"SWIG": 2, "SWIG": 2,
@ -631,6 +641,7 @@ var LanguagesType = map[string]int{
"WebIDL": 2, "WebIDL": 2,
"WebVTT": 1, "WebVTT": 1,
"Wget Config": 1, "Wget Config": 1,
"Whiley": 2,
"Wikitext": 4, "Wikitext": 4,
"Win32 Message File": 1, "Win32 Message File": 1,
"Windows Registry Entries": 1, "Windows Registry Entries": 1,
@ -658,6 +669,7 @@ var LanguagesType = map[string]int{
"YARA": 2, "YARA": 2,
"YASnippet": 3, "YASnippet": 3,
"Yacc": 2, "Yacc": 2,
"Yul": 2,
"ZAP": 2, "ZAP": 2,
"ZIL": 2, "ZIL": 2,
"Zeek": 2, "Zeek": 2,

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -171,4 +171,8 @@ var VendorMatchers = []regex.EnryRegexp{
regex.MustCompile(`(^|/)\.google_apis/`), regex.MustCompile(`(^|/)\.google_apis/`),
regex.MustCompile(`(^|/)Jenkinsfile$`), regex.MustCompile(`(^|/)Jenkinsfile$`),
regex.MustCompile(`(^|/)\.gitpod\.Dockerfile$`), regex.MustCompile(`(^|/)\.gitpod\.Dockerfile$`),
regex.MustCompile(`(^|/)\.github/`),
} }
// FastVendorMatcher is equivalent to matching any of the VendorMatchers.
var FastVendorMatcher = regex.MustCompile(`(?:^(?:(?:[Dd]ependencies/)|(?:debian/)|(?:deps/)|(?:rebar$)))|(?:(?:^|/)(?:(?:BuddyBuildSDK\.framework/)|(?:Carthage/)|(?:Chart\.js$)|(?:Control\.FullScreen\.css)|(?:Control\.FullScreen\.js)|(?:Crashlytics\.framework/)|(?:Fabric\.framework/)|(?:Godeps/_workspace/)|(?:Jenkinsfile$)|(?:Leaflet\.Coordinates-\d+\.\d+\.\d+\.src\.js$)|(?:MathJax/)|(?:MochiKit\.js$)|(?:RealmSwift\.framework)|(?:Realm\.framework)|(?:Sparkle/)|(?:Vagrantfile$)|(?:[Bb]ourbon/.*\.(css|less|scss|styl)$)|(?:[Cc]ode[Mm]irror/(\d+\.\d+/)?(lib|mode|theme|addon|keymap|demo))|(?:[Ee]xtern(als?)?/)|(?:[Mm]icrosoft([Mm]vc)?([Aa]jax|[Vv]alidation)(\.debug)?\.js$)|(?:[Pp]ackages\/.+\.\d+\/)|(?:[Ss]pecs?/fixtures/)|(?:[Tt]ests?/fixtures/)|(?:[Vv]+endor/)|(?:\.[Dd][Ss]_[Ss]tore$)|(?:\.gitattributes$)|(?:\.github/)|(?:\.gitignore$)|(?:\.gitmodules$)|(?:\.gitpod\.Dockerfile$)|(?:\.google_apis/)|(?:\.indent\.pro)|(?:\.mvn/wrapper/)|(?:\.osx$)|(?:\.sublime-project)|(?:\.sublime-workspace)|(?:\.vscode/)|(?:\.yarn/plugins/)|(?:\.yarn/releases/)|(?:\.yarn/sdks/)|(?:\.yarn/unplugged/)|(?:\.yarn/versions/)|(?:_esy$)|(?:ace-builds/)|(?:aclocal\.m4)|(?:activator$)|(?:activator\.bat$)|(?:admin_media/)|(?:angular([^.]*)\.js$)|(?:animate\.(css|less|scss|styl)$)|(?:bootbox\.js)|(?:bootstrap([^/.]*)\.(js|css|less|scss|styl)$)|(?:bootstrap-datepicker/)|(?:bower_components/)|(?:bulma\.(css|sass|scss)$)|(?:cache/)|(?:ckeditor\.js$)|(?:config\.guess$)|(?:config\.sub$)|(?:configure$)|(?:controls\.js$)|(?:cordova([^.]*)\.js$)|(?:cordova\-\d\.\d(\.\d)?\.js$)|(?:cpplint\.py)|(?:custom\.bootstrap([^\s]*)(js|css|less|scss|styl)$)|(?:dist/)|(?:docs?/_?(build|themes?|templates?|static)/)|(?:dojo\.js$)|(?:dotnet-install\.(ps1|sh)$)|(?:dragdrop\.js$)|(?:effects\.js$)|(?:env/)|(?:erlang\.mk)|(?:extjs/.*?\.html$)|(?:extjs/.*?\.js$)|(?:extjs/.*?\.properties$)|(?:extjs/.*?\.txt$)|(?:extjs/.*?\.xml$)|(?:extjs/\.sencha/)|(?:extjs/builds/)|(?:extjs/cmd/)|(?:extjs/docs/)|(?:extjs/examples/)|(?:extjs/locale/)|(?:extjs/packages/)|(?:extjs/plugins/)|(?:extjs/resources/)|(?:extjs/src/)|(?:extjs/welcome/)|(?:fabfile\.py$)|(?:flow-typed/.*\.js$)|(?:font-?awesome/.*\.(css|less|scss|styl)$)|(?:font-?awesome\.(css|less|scss|styl)$)|(?:fontello(.*?)\.css$)|(?:foundation(\..*)?\.js$)|(?:foundation\.(css|less|scss|styl)$)|(?:fuelux\.js)|(?:gradle/wrapper/)|(?:gradlew$)|(?:gradlew\.bat$)|(?:html5shiv\.js$)|(?:inst/extdata/)|(?:jquery([^.]*)\.js$)|(?:jquery([^.]*)\.unobtrusive\-ajax\.js$)|(?:jquery([^.]*)\.validate(\.unobtrusive)?\.js$)|(?:jquery\-\d\.\d+(\.\d+)?\.js$)|(?:jquery\-ui(\-\d\.\d+(\.\d+)?)?(\.\w+)?\.(js|css)$)|(?:jquery\.(ui|effects)\.([^.]*)\.(js|css)$)|(?:jquery\.dataTables\.js)|(?:jquery\.fancybox\.(js|css))|(?:jquery\.fileupload(-\w+)?\.js$)|(?:jquery\.fn\.gantt\.js)|(?:knockout-(\d+\.){3}(debug\.)?js$)|(?:leaflet\.draw-src\.js)|(?:leaflet\.draw\.css)|(?:leaflet\.spin\.js)|(?:libtool\.m4)|(?:ltoptions\.m4)|(?:ltsugar\.m4)|(?:ltversion\.m4)|(?:lt~obsolete\.m4)|(?:materialize\.(css|less|scss|styl|js)$)|(?:modernizr\-\d\.\d+(\.\d+)?\.js$)|(?:modernizr\.custom\.\d+\.js$)|(?:mootools([^.]*)\d+\.\d+.\d+([^.]*)\.js$)|(?:mvnw$)|(?:mvnw\.cmd$)|(?:node_modules/)|(?:normalize\.(css|less|scss|styl)$)|(?:octicons\.css)|(?:pdf\.worker\.js)|(?:proguard-rules\.pro$)|(?:proguard\.pro$)|(?:prototype(.*)\.js$)|(?:puphpet/)|(?:react(-[^.]*)?\.js$)|(?:run\.n$)|(?:select2/.*\.(css|scss|js)$)|(?:shBrush([^.]*)\.js$)|(?:shCore\.js$)|(?:shLegacy\.js$)|(?:skeleton\.(css|less|scss|styl)$)|(?:slick\.\w+.js$)|(?:sprockets-octicons\.scss)|(?:testdata/)|(?:tiny_mce([^.]*)\.js$)|(?:tiny_mce/(langs|plugins|themes|utils))|(?:vendors?/)|(?:vignettes/)|(?:waf$)|(?:wicket-leaflet\.js)|(?:yahoo-([^.]*)\.js$)|(?:yui([^.]*)\.js$)))|(?:(.*?)\.d\.ts$)|(?:(3rd|[Tt]hird)[-_]?[Pp]arty/)|(?:([^\s]*)import\.(css|less|scss|styl)$)|(?:(\.|-)min\.(js|css)$)|(?:(^|\/)d3(\.v\d+)?([^.]*)\.js$)|(?:-vsdoc\.js$)|(?:\.imageset/)|(?:\.intellisense\.js$)|(?:\.xctemplate/)`)

14
enry.go
View File

@ -14,3 +14,17 @@
package enry // import "github.com/go-enry/go-enry/v2" package enry // import "github.com/go-enry/go-enry/v2"
//go:generate make code-generate //go:generate make code-generate
import "github.com/go-enry/go-enry/v2/data"
// Type represent language's type. Either data, programming, markup, prose, or unknown.
type Type int
// Type's values.
const (
Unknown Type = Type(data.TypeUnknown)
Data = Type(data.TypeData)
Programming = Type(data.TypeProgramming)
Markup = Type(data.TypeMarkup)
Prose = Type(data.TypeProse)
)

View File

@ -22,8 +22,9 @@ func LanguageByAlias(langOrAlias string) (lang string, ok bool) {
// convertToAliasKey converts language name to a key in LanguageByAliasMap. // convertToAliasKey converts language name to a key in LanguageByAliasMap.
// Following // Following
// - internal.code-generator.generator.convertToAliasKey() // - internal.code-generator.generator.convertToAliasKey()
// - GetLanguageByAlias() // - GetLanguageByAlias()
//
// conventions. // conventions.
// It is here to avoid dependency on "generate" and "enry" packages. // It is here to avoid dependency on "generate" and "enry" packages.
func convertToAliasKey(langName string) string { func convertToAliasKey(langName string) string {

View File

@ -7,3 +7,6 @@ var VendorMatchers = []regex.EnryRegexp{
regex.MustCompile(`{{ $regexp }}`), regex.MustCompile(`{{ $regexp }}`),
{{end -}} {{end -}}
} }
// FastVendorMatcher is equivalent to matching any of the VendorMatchers.
var FastVendorMatcher = regex.MustCompile(`{{ optimize . }}`)

View File

@ -19,7 +19,7 @@ import (
var ( var (
linguistURL = "https://github.com/github/linguist.git" linguistURL = "https://github.com/github/linguist.git"
linguistClonedEnvVar = "ENRY_TEST_REPO" linguistClonedEnvVar = "ENRY_TEST_REPO"
commit = "4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26" commit = "d7799da826e01acdb8f84694d33116dccaabe9c2"
samplesDir = "samples" samplesDir = "samples"
languagesFile = filepath.Join("lib", "linguist", "languages.yml") languagesFile = filepath.Join("lib", "linguist", "languages.yml")
@ -97,9 +97,9 @@ var (
type GeneratorTestSuite struct { type GeneratorTestSuite struct {
suite.Suite suite.Suite
tmpLinguist string tmpLinguistDir string
cloned bool isCleanupNeeded bool
testCases []testCase testCases []testCase
} }
type testCase struct { type testCase struct {
@ -121,28 +121,32 @@ func Test_GeneratorTestSuite(t *testing.T) {
func (s *GeneratorTestSuite) maybeCloneLinguist() { func (s *GeneratorTestSuite) maybeCloneLinguist() {
var err error var err error
s.tmpLinguist = os.Getenv(linguistClonedEnvVar) s.tmpLinguistDir = os.Getenv(linguistClonedEnvVar)
s.cloned = s.tmpLinguist == "" isLinguistCloned := s.tmpLinguistDir != ""
if s.cloned { if !isLinguistCloned {
s.tmpLinguist, err = ioutil.TempDir("", "linguist-") s.tmpLinguistDir, err = ioutil.TempDir("", "linguist-")
assert.NoError(s.T(), err) require.NoError(s.T(), err)
cmd := exec.Command("git", "clone", linguistURL, s.tmpLinguist)
s.T().Logf("Cloning Linguist repo to '%s' as %s was not set\n",
s.tmpLinguistDir, linguistClonedEnvVar)
cmd := exec.Command("git", "clone", "--depth", "100", linguistURL, s.tmpLinguistDir)
err = cmd.Run() err = cmd.Run()
assert.NoError(s.T(), err) require.NoError(s.T(), err)
s.isCleanupNeeded = true
cwd, err := os.Getwd()
assert.NoError(s.T(), err)
err = os.Chdir(s.tmpLinguist)
assert.NoError(s.T(), err)
cmd = exec.Command("git", "checkout", commit)
err = cmd.Run()
assert.NoError(s.T(), err)
err = os.Chdir(cwd)
assert.NoError(s.T(), err)
} }
cwd, err := os.Getwd()
require.NoError(s.T(), err)
err = os.Chdir(s.tmpLinguistDir)
require.NoError(s.T(), err)
cmd := exec.Command("git", "checkout", commit)
err = cmd.Run()
require.NoError(s.T(), err)
err = os.Chdir(cwd)
require.NoError(s.T(), err)
} }
func (s *GeneratorTestSuite) SetupSuite() { func (s *GeneratorTestSuite) SetupSuite() {
@ -150,7 +154,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
s.testCases = []testCase{ s.testCases = []testCase{
{ {
name: "Extensions()", name: "Extensions()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: "", samplesDir: "",
tmplPath: extensionTestTmplPath, tmplPath: extensionTestTmplPath,
tmplName: extensionTestTmplName, tmplName: extensionTestTmplName,
@ -160,7 +164,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Heuristics()", name: "Heuristics()",
fileToParse: filepath.Join(s.tmpLinguist, heuristicsTestFile), fileToParse: filepath.Join(s.tmpLinguistDir, heuristicsTestFile),
samplesDir: "", samplesDir: "",
tmplPath: contentTestTmplPath, tmplPath: contentTestTmplPath,
tmplName: contentTestTmplName, tmplName: contentTestTmplName,
@ -170,7 +174,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Vendor()", name: "Vendor()",
fileToParse: filepath.Join(s.tmpLinguist, vendorTestFile), fileToParse: filepath.Join(s.tmpLinguistDir, vendorTestFile),
samplesDir: "", samplesDir: "",
tmplPath: vendorTestTmplPath, tmplPath: vendorTestTmplPath,
tmplName: vendorTestTmplName, tmplName: vendorTestTmplName,
@ -180,7 +184,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Documentation()", name: "Documentation()",
fileToParse: filepath.Join(s.tmpLinguist, documentationTestFile), fileToParse: filepath.Join(s.tmpLinguistDir, documentationTestFile),
samplesDir: "", samplesDir: "",
tmplPath: documentationTestTmplPath, tmplPath: documentationTestTmplPath,
tmplName: documentationTestTmplName, tmplName: documentationTestTmplName,
@ -190,7 +194,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Types()", name: "Types()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: "", samplesDir: "",
tmplPath: typeTestTmplPath, tmplPath: typeTestTmplPath,
tmplName: typeTestTmplName, tmplName: typeTestTmplName,
@ -200,7 +204,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Interpreters()", name: "Interpreters()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: "", samplesDir: "",
tmplPath: interpreterTestTmplPath, tmplPath: interpreterTestTmplPath,
tmplName: interpreterTestTmplName, tmplName: interpreterTestTmplName,
@ -210,8 +214,8 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Filenames()", name: "Filenames()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: filepath.Join(s.tmpLinguist, samplesDir), samplesDir: filepath.Join(s.tmpLinguistDir, samplesDir),
tmplPath: filenameTestTmplPath, tmplPath: filenameTestTmplPath,
tmplName: filenameTestTmplName, tmplName: filenameTestTmplName,
commit: commit, commit: commit,
@ -220,7 +224,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Aliases()", name: "Aliases()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: "", samplesDir: "",
tmplPath: aliasTestTmplPath, tmplPath: aliasTestTmplPath,
tmplName: aliasTestTmplName, tmplName: aliasTestTmplName,
@ -230,7 +234,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Frequencies()", name: "Frequencies()",
samplesDir: filepath.Join(s.tmpLinguist, samplesDir), samplesDir: filepath.Join(s.tmpLinguistDir, samplesDir),
tmplPath: frequenciesTestTmplPath, tmplPath: frequenciesTestTmplPath,
tmplName: frequenciesTestTmplName, tmplName: frequenciesTestTmplName,
commit: commit, commit: commit,
@ -248,7 +252,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "MimeType()", name: "MimeType()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: "", samplesDir: "",
tmplPath: mimeTypeTestTmplPath, tmplPath: mimeTypeTestTmplPath,
tmplName: mimeTypeTestTmplName, tmplName: mimeTypeTestTmplName,
@ -258,7 +262,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Colors()", name: "Colors()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: "", samplesDir: "",
tmplPath: colorsTestTmplPath, tmplPath: colorsTestTmplPath,
tmplName: colorsTestTmplName, tmplName: colorsTestTmplName,
@ -268,7 +272,7 @@ func (s *GeneratorTestSuite) SetupSuite() {
}, },
{ {
name: "Groups()", name: "Groups()",
fileToParse: filepath.Join(s.tmpLinguist, languagesFile), fileToParse: filepath.Join(s.tmpLinguistDir, languagesFile),
samplesDir: "", samplesDir: "",
tmplPath: groupsTestTmplPath, tmplPath: groupsTestTmplPath,
tmplName: groupsTestTmplName, tmplName: groupsTestTmplName,
@ -280,11 +284,9 @@ func (s *GeneratorTestSuite) SetupSuite() {
} }
func (s *GeneratorTestSuite) TearDownSuite() { func (s *GeneratorTestSuite) TearDownSuite() {
if s.cloned { if s.isCleanupNeeded {
err := os.RemoveAll(s.tmpLinguist) err := os.RemoveAll(s.tmpLinguistDir)
if err != nil { assert.NoError(s.T(), err)
s.T().Logf("Failed to clean up %s after the test.\n", s.tmpLinguist)
}
} }
} }
@ -331,7 +333,7 @@ func (s *GeneratorTestSuite) TestGenerationFiles() {
func (s *GeneratorTestSuite) TestTokenizerOnATS() { func (s *GeneratorTestSuite) TestTokenizerOnATS() {
const suspiciousSample = "samples/ATS/csv_parse.hats" const suspiciousSample = "samples/ATS/csv_parse.hats"
sFile := filepath.Join(s.tmpLinguist, suspiciousSample) sFile := filepath.Join(s.tmpLinguistDir, suspiciousSample)
content, err := ioutil.ReadFile(sFile) content, err := ioutil.ReadFile(sFile)
require.NoError(s.T(), err) require.NoError(s.T(), err)

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -44,6 +44,7 @@ var LanguageByAliasMap = map[string]string{
"amusewiki": "Muse", "amusewiki": "Muse",
"angelscript": "AngelScript", "angelscript": "AngelScript",
"ant_build_system": "Ant Build System", "ant_build_system": "Ant Build System",
"antlers": "Antlers",
"antlr": "ANTLR", "antlr": "ANTLR",
"apache": "ApacheConf", "apache": "ApacheConf",
"apacheconf": "ApacheConf", "apacheconf": "ApacheConf",
@ -56,6 +57,7 @@ var LanguageByAliasMap = map[string]string{
"arc": "Arc", "arc": "Arc",
"arexx": "REXX", "arexx": "REXX",
"as3": "ActionScript", "as3": "ActionScript",
"ascii_stl": "STL",
"asciidoc": "AsciiDoc", "asciidoc": "AsciiDoc",
"asl": "ASL", "asl": "ASL",
"asm": "Assembly", "asm": "Assembly",
@ -94,6 +96,7 @@ var LanguageByAliasMap = map[string]string{
"berry": "Berry", "berry": "Berry",
"bibtex": "BibTeX", "bibtex": "BibTeX",
"bicep": "Bicep", "bicep": "Bicep",
"bikeshed": "Bikeshed",
"bison": "Bison", "bison": "Bison",
"bitbake": "BitBake", "bitbake": "BitBake",
"blade": "Blade", "blade": "Blade",
@ -107,6 +110,7 @@ var LanguageByAliasMap = map[string]string{
"boogie": "Boogie", "boogie": "Boogie",
"bplus": "BlitzBasic", "bplus": "BlitzBasic",
"brainfuck": "Brainfuck", "brainfuck": "Brainfuck",
"brighterscript": "BrighterScript",
"brightscript": "Brightscript", "brightscript": "Brightscript",
"bro": "Zeek", "bro": "Zeek",
"browserslist": "Browserslist", "browserslist": "Browserslist",
@ -128,14 +132,18 @@ var LanguageByAliasMap = map[string]string{
"cakescript": "C#", "cakescript": "C#",
"cameligo": "CameLIGO", "cameligo": "CameLIGO",
"cap'n_proto": "Cap'n Proto", "cap'n_proto": "Cap'n Proto",
"cap_cds": "CAP CDS",
"carto": "CartoCSS", "carto": "CartoCSS",
"cartocss": "CartoCSS", "cartocss": "CartoCSS",
"cds": "CAP CDS",
"ceylon": "Ceylon", "ceylon": "Ceylon",
"cfc": "ColdFusion CFC", "cfc": "ColdFusion CFC",
"cfm": "ColdFusion", "cfm": "ColdFusion",
"cfml": "ColdFusion", "cfml": "ColdFusion",
"chapel": "Chapel", "chapel": "Chapel",
"charity": "Charity", "charity": "Charity",
"checksum": "Checksums",
"checksums": "Checksums",
"chpl": "Chapel", "chpl": "Chapel",
"chuck": "ChucK", "chuck": "ChucK",
"cil": "CIL", "cil": "CIL",
@ -293,6 +301,7 @@ var LanguageByAliasMap = map[string]string{
"gaml": "GAML", "gaml": "GAML",
"gams": "GAMS", "gams": "GAMS",
"gap": "GAP", "gap": "GAP",
"gas": "Unix Assembly",
"gcc_machine_description": "GCC Machine Description", "gcc_machine_description": "GCC Machine Description",
"gdb": "GDB", "gdb": "GDB",
"gdscript": "GDScript", "gdscript": "GDScript",
@ -304,13 +313,16 @@ var LanguageByAliasMap = map[string]string{
"genshi": "Genshi", "genshi": "Genshi",
"gentoo_ebuild": "Gentoo Ebuild", "gentoo_ebuild": "Gentoo Ebuild",
"gentoo_eclass": "Gentoo Eclass", "gentoo_eclass": "Gentoo Eclass",
"geojson": "JSON",
"gerber_image": "Gerber Image", "gerber_image": "Gerber Image",
"gettext_catalog": "Gettext Catalog", "gettext_catalog": "Gettext Catalog",
"gf": "Grammatical Framework", "gf": "Grammatical Framework",
"gherkin": "Gherkin", "gherkin": "Gherkin",
"git-ignore": "Ignore List", "git-ignore": "Ignore List",
"git_attributes": "Git Attributes", "git_attributes": "Git Attributes",
"git_blame_ignore_revs": "Git Revision List",
"git_config": "Git Config", "git_config": "Git Config",
"git_revision_list": "Git Revision List",
"gitattributes": "Git Attributes", "gitattributes": "Git Attributes",
"gitconfig": "Git Config", "gitconfig": "Git Config",
"gitignore": "Ignore List", "gitignore": "Ignore List",
@ -320,6 +332,7 @@ var LanguageByAliasMap = map[string]string{
"glyph": "Glyph", "glyph": "Glyph",
"glyph_bitmap_distribution_format": "Glyph Bitmap Distribution Format", "glyph_bitmap_distribution_format": "Glyph Bitmap Distribution Format",
"gn": "GN", "gn": "GN",
"gnu_asm": "Unix Assembly",
"gnuplot": "Gnuplot", "gnuplot": "Gnuplot",
"go": "Go", "go": "Go",
"go.mod": "Go Module", "go.mod": "Go Module",
@ -347,6 +360,8 @@ var LanguageByAliasMap = map[string]string{
"handlebars": "Handlebars", "handlebars": "Handlebars",
"haproxy": "HAProxy", "haproxy": "HAProxy",
"harbour": "Harbour", "harbour": "Harbour",
"hash": "Checksums",
"hashes": "Checksums",
"hashicorp_configuration_language": "HCL", "hashicorp_configuration_language": "HCL",
"haskell": "Haskell", "haskell": "Haskell",
"haxe": "Haxe", "haxe": "Haxe",
@ -410,6 +425,7 @@ var LanguageByAliasMap = map[string]string{
"javascript": "JavaScript", "javascript": "JavaScript",
"javascript+erb": "JavaScript+ERB", "javascript+erb": "JavaScript+ERB",
"jest_snapshot": "Jest Snapshot", "jest_snapshot": "Jest Snapshot",
"jetbrains_mps": "JetBrains MPS",
"jflex": "JFlex", "jflex": "JFlex",
"jinja": "Jinja", "jinja": "Jinja",
"jison": "Jison", "jison": "Jison",
@ -423,6 +439,7 @@ var LanguageByAliasMap = map[string]string{
"json_with_comments": "JSON with Comments", "json_with_comments": "JSON with Comments",
"jsonc": "JSON with Comments", "jsonc": "JSON with Comments",
"jsoniq": "JSONiq", "jsoniq": "JSONiq",
"jsonl": "JSON",
"jsonld": "JSONLD", "jsonld": "JSONLD",
"jsonnet": "Jsonnet", "jsonnet": "Jsonnet",
"jsp": "Java Server Pages", "jsp": "Java Server Pages",
@ -532,6 +549,7 @@ var LanguageByAliasMap = map[string]string{
"moonscript": "MoonScript", "moonscript": "MoonScript",
"motoko": "Motoko", "motoko": "Motoko",
"motorola_68k_assembly": "Motorola 68K Assembly", "motorola_68k_assembly": "Motorola 68K Assembly",
"mps": "JetBrains MPS",
"mql4": "MQL4", "mql4": "MQL4",
"mql5": "MQL5", "mql5": "MQL5",
"mtml": "MTML", "mtml": "MTML",
@ -649,6 +667,7 @@ var LanguageByAliasMap = map[string]string{
"pod_6": "Pod 6", "pod_6": "Pod 6",
"pogoscript": "PogoScript", "pogoscript": "PogoScript",
"pony": "Pony", "pony": "Pony",
"portugol": "Portugol",
"posh": "PowerShell", "posh": "PowerShell",
"postcss": "PostCSS", "postcss": "PostCSS",
"postscr": "PostScript", "postscr": "PostScript",
@ -810,13 +829,18 @@ var LanguageByAliasMap = map[string]string{
"ssh_config": "SSH Config", "ssh_config": "SSH Config",
"stan": "Stan", "stan": "Stan",
"standard_ml": "Standard ML", "standard_ml": "Standard ML",
"star": "STAR",
"starlark": "Starlark", "starlark": "Starlark",
"stata": "Stata", "stata": "Stata",
"stl": "STL",
"stla": "STL",
"ston": "STON", "ston": "STON",
"stringtemplate": "StringTemplate", "stringtemplate": "StringTemplate",
"stylus": "Stylus", "stylus": "Stylus",
"subrip_text": "SubRip Text", "subrip_text": "SubRip Text",
"sugarss": "SugarSS", "sugarss": "SugarSS",
"sum": "Checksums",
"sums": "Checksums",
"supercollider": "SuperCollider", "supercollider": "SuperCollider",
"svelte": "Svelte", "svelte": "Svelte",
"svg": "SVG", "svg": "SVG",
@ -841,6 +865,7 @@ var LanguageByAliasMap = map[string]string{
"tla": "TLA", "tla": "TLA",
"tm-properties": "TextMate Properties", "tm-properties": "TextMate Properties",
"toml": "TOML", "toml": "TOML",
"topojson": "JSON",
"troff": "Roff", "troff": "Roff",
"ts": "TypeScript", "ts": "TypeScript",
"tsql": "TSQL", "tsql": "TSQL",
@ -857,6 +882,7 @@ var LanguageByAliasMap = map[string]string{
"ultisnips": "Vim Snippet", "ultisnips": "Vim Snippet",
"unified_parallel_c": "Unified Parallel C", "unified_parallel_c": "Unified Parallel C",
"unity3d_asset": "Unity3D Asset", "unity3d_asset": "Unity3D Asset",
"unix_asm": "Unix Assembly",
"unix_assembly": "Unix Assembly", "unix_assembly": "Unix Assembly",
"uno": "Uno", "uno": "Uno",
"unrealscript": "UnrealScript", "unrealscript": "UnrealScript",
@ -888,6 +914,7 @@ var LanguageByAliasMap = map[string]string{
"visual_basic_for_applications": "VBA", "visual_basic_for_applications": "VBA",
"vlang": "V", "vlang": "V",
"volt": "Volt", "volt": "Volt",
"vtt": "WebVTT",
"vue": "Vue", "vue": "Vue",
"vyper": "Vyper", "vyper": "Vyper",
"wasm": "WebAssembly", "wasm": "WebAssembly",
@ -901,6 +928,7 @@ var LanguageByAliasMap = map[string]string{
"webvtt": "WebVTT", "webvtt": "WebVTT",
"wget_config": "Wget Config", "wget_config": "Wget Config",
"wgetrc": "Wget Config", "wgetrc": "Wget Config",
"whiley": "Whiley",
"wiki": "Wikitext", "wiki": "Wikitext",
"wikitext": "Wikitext", "wikitext": "Wikitext",
"win32_message_file": "Win32 Message File", "win32_message_file": "Win32 Message File",
@ -948,6 +976,7 @@ var LanguageByAliasMap = map[string]string{
"yas": "YASnippet", "yas": "YASnippet",
"yasnippet": "YASnippet", "yasnippet": "YASnippet",
"yml": "YAML", "yml": "YAML",
"yul": "Yul",
"zap": "ZAP", "zap": "ZAP",
"zeek": "Zeek", "zeek": "Zeek",
"zenscript": "ZenScript", "zenscript": "ZenScript",
@ -969,8 +998,9 @@ func LanguageByAlias(langOrAlias string) (lang string, ok bool) {
// convertToAliasKey converts language name to a key in LanguageByAliasMap. // convertToAliasKey converts language name to a key in LanguageByAliasMap.
// Following // Following
// - internal.code-generator.generator.convertToAliasKey() // - internal.code-generator.generator.convertToAliasKey()
// - GetLanguageByAlias() // - GetLanguageByAlias()
//
// conventions. // conventions.
// It is here to avoid dependency on "generate" and "enry" packages. // It is here to avoid dependency on "generate" and "enry" packages.
func convertToAliasKey(langName string) string { func convertToAliasKey(langName string) string {

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -27,6 +27,7 @@ var LanguagesColor = map[string]string{
"Altium Designer": "#A89663", "Altium Designer": "#A89663",
"AngelScript": "#C7D7DC", "AngelScript": "#C7D7DC",
"Ant Build System": "#A9157E", "Ant Build System": "#A9157E",
"Antlers": "#ff269e",
"ApacheConf": "#d12127", "ApacheConf": "#d12127",
"Apex": "#1797c0", "Apex": "#1797c0",
"Apollo Guidance Computer": "#0B3D91", "Apollo Guidance Computer": "#0B3D91",
@ -49,6 +50,7 @@ var LanguagesColor = map[string]string{
"Berry": "#15A13C", "Berry": "#15A13C",
"BibTeX": "#778899", "BibTeX": "#778899",
"Bicep": "#519aba", "Bicep": "#519aba",
"Bikeshed": "#5562ac",
"Bison": "#6A463F", "Bison": "#6A463F",
"BitBake": "#00bce4", "BitBake": "#00bce4",
"Blade": "#f7523f", "Blade": "#f7523f",
@ -58,11 +60,13 @@ var LanguagesColor = map[string]string{
"Boo": "#d4bec1", "Boo": "#d4bec1",
"Boogie": "#c80fa0", "Boogie": "#c80fa0",
"Brainfuck": "#2F2530", "Brainfuck": "#2F2530",
"BrighterScript": "#66AABB",
"Brightscript": "#662D91", "Brightscript": "#662D91",
"Browserslist": "#ffd539", "Browserslist": "#ffd539",
"C": "#555555", "C": "#555555",
"C#": "#178600", "C#": "#178600",
"C++": "#f34b7d", "C++": "#f34b7d",
"CAP CDS": "#0092d1",
"CLIPS": "#00A300", "CLIPS": "#00A300",
"CMake": "#DA3434", "CMake": "#DA3434",
"COLLADA": "#F1A42B", "COLLADA": "#F1A42B",
@ -171,6 +175,7 @@ var LanguagesColor = map[string]string{
"Gherkin": "#5B2063", "Gherkin": "#5B2063",
"Git Attributes": "#F44D27", "Git Attributes": "#F44D27",
"Git Config": "#F44D27", "Git Config": "#F44D27",
"Git Revision List": "#F44D27",
"Gleam": "#ffaff3", "Gleam": "#ffaff3",
"Glyph": "#c1ac7f", "Glyph": "#c1ac7f",
"Gnuplot": "#f0a9f0", "Gnuplot": "#f0a9f0",
@ -232,6 +237,7 @@ var LanguagesColor = map[string]string{
"JavaScript": "#f1e05a", "JavaScript": "#f1e05a",
"JavaScript+ERB": "#f1e05a", "JavaScript+ERB": "#f1e05a",
"Jest Snapshot": "#15c213", "Jest Snapshot": "#15c213",
"JetBrains MPS": "#21D789",
"Jinja": "#a52a22", "Jinja": "#a52a22",
"Jison": "#56b3cb", "Jison": "#56b3cb",
"Jison Lex": "#56b3cb", "Jison Lex": "#56b3cb",
@ -344,6 +350,7 @@ var LanguagesColor = map[string]string{
"PigLatin": "#fcd7de", "PigLatin": "#fcd7de",
"Pike": "#005390", "Pike": "#005390",
"PogoScript": "#d80074", "PogoScript": "#d80074",
"Portugol": "#f8bd00",
"PostCSS": "#dc3a0c", "PostCSS": "#dc3a0c",
"PostScript": "#da291c", "PostScript": "#da291c",
"PowerBuilder": "#8f0f8d", "PowerBuilder": "#8f0f8d",
@ -399,6 +406,7 @@ var LanguagesColor = map[string]string{
"SQL": "#e38c00", "SQL": "#e38c00",
"SQLPL": "#e38c00", "SQLPL": "#e38c00",
"SRecode Template": "#348a34", "SRecode Template": "#348a34",
"STL": "#373b5e",
"SVG": "#ff9900", "SVG": "#ff9900",
"SaltStack": "#646464", "SaltStack": "#646464",
"Sass": "#a53b70", "Sass": "#a53b70",
@ -438,7 +446,7 @@ var LanguagesColor = map[string]string{
"TOML": "#9c4221", "TOML": "#9c4221",
"TSQL": "#e38c00", "TSQL": "#e38c00",
"TSV": "#237346", "TSV": "#237346",
"TSX": "#2b7489", "TSX": "#3178c6",
"TXL": "#0178b8", "TXL": "#0178b8",
"Talon": "#333333", "Talon": "#333333",
"Tcl": "#e4cc98", "Tcl": "#e4cc98",
@ -449,7 +457,7 @@ var LanguagesColor = map[string]string{
"Thrift": "#D12127", "Thrift": "#D12127",
"Turing": "#cf142b", "Turing": "#cf142b",
"Twig": "#c1d026", "Twig": "#c1d026",
"TypeScript": "#2b7489", "TypeScript": "#3178c6",
"Unified Parallel C": "#4e3617", "Unified Parallel C": "#4e3617",
"Unity3D Asset": "#222c37", "Unity3D Asset": "#222c37",
"Uno": "#9933cc", "Uno": "#9933cc",
@ -472,6 +480,7 @@ var LanguagesColor = map[string]string{
"Vyper": "#2980b9", "Vyper": "#2980b9",
"Web Ontology Language": "#5b70bd", "Web Ontology Language": "#5b70bd",
"WebAssembly": "#04133b", "WebAssembly": "#04133b",
"Whiley": "#d5c397",
"Wikitext": "#fc5757", "Wikitext": "#fc5757",
"Windows Registry Entries": "#52d5ff", "Windows Registry Entries": "#52d5ff",
"Witcher Script": "#ff0000", "Witcher Script": "#ff0000",
@ -490,6 +499,7 @@ var LanguagesColor = map[string]string{
"YARA": "#220000", "YARA": "#220000",
"YASnippet": "#32AB90", "YASnippet": "#32AB90",
"Yacc": "#4B6C4B", "Yacc": "#4B6C4B",
"Yul": "#794932",
"ZAP": "#0d665e", "ZAP": "#0d665e",
"ZIL": "#dc75e5", "ZIL": "#dc75e5",
"ZenScript": "#00BCD1", "ZenScript": "#00BCD1",

View File

@ -1,7 +1,7 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
// linguist's commit from which files were generated. // linguist's commit from which files were generated.
var LinguistCommit = "4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26" var LinguistCommit = "d7799da826e01acdb8f84694d33116dccaabe9c2"

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -638,6 +638,10 @@ var ContentHeuristics = map[string]*Heuristics{
rule.MatchingLanguages("BitBake"), rule.MatchingLanguages("BitBake"),
regexp.MustCompile(`(?m)^\s*(# |include|require)\b`), regexp.MustCompile(`(?m)^\s*(# |include|require)\b`),
), ),
rule.Or(
rule.MatchingLanguages("Clojure"),
regexp.MustCompile(`(?m)\((def|defn|defmacro|let)\s`),
),
}, },
".bi": &Heuristics{ ".bi": &Heuristics{
rule.Or( rule.Or(
@ -645,6 +649,7 @@ var ContentHeuristics = map[string]*Heuristics{
regexp.MustCompile(`(?m)^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s`), regexp.MustCompile(`(?m)^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s`),
), ),
}, },
".bs": &Heuristics{},
".builds": &Heuristics{ ".builds": &Heuristics{
rule.Or( rule.Or(
rule.MatchingLanguages("XML"), rule.MatchingLanguages("XML"),
@ -1472,6 +1477,16 @@ var ContentHeuristics = map[string]*Heuristics{
regexp.MustCompile(`(?m)\A\s*[\[{(^"'\w#]|[a-zA-Z_]\w*\s*:=\s*[a-zA-Z_]\w*|class\s*>>\s*[a-zA-Z_]\w*|^[a-zA-Z_]\w*\s+[a-zA-Z_]\w*:|^Class\s*{|if(?:True|False):\s*\[`), regexp.MustCompile(`(?m)\A\s*[\[{(^"'\w#]|[a-zA-Z_]\w*\s*:=\s*[a-zA-Z_]\w*|class\s*>>\s*[a-zA-Z_]\w*|^[a-zA-Z_]\w*\s+[a-zA-Z_]\w*:|^Class\s*{|if(?:True|False):\s*\[`),
), ),
}, },
".star": &Heuristics{
rule.Or(
rule.MatchingLanguages("STAR"),
regexp.MustCompile(`(?m)^loop_\s*$`),
),
rule.Always(
rule.MatchingLanguages("Starlark"),
),
},
".stl": &Heuristics{},
".t": &Heuristics{ ".t": &Heuristics{
rule.Or( rule.Or(
rule.MatchingLanguages("Perl"), rule.MatchingLanguages("Perl"),

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -18,7 +18,9 @@ var LanguagesByExtension = map[string][]string{
".3qt": {"Roff", "Roff Manpage"}, ".3qt": {"Roff", "Roff Manpage"},
".3x": {"Roff", "Roff Manpage"}, ".3x": {"Roff", "Roff Manpage"},
".4": {"Roff", "Roff Manpage"}, ".4": {"Roff", "Roff Manpage"},
".4dform": {"JSON"},
".4dm": {"4D"}, ".4dm": {"4D"},
".4dproject": {"JSON"},
".4gl": {"Genero"}, ".4gl": {"Genero"},
".4th": {"Forth"}, ".4th": {"Forth"},
".5": {"Roff", "Roff Manpage"}, ".5": {"Roff", "Roff Manpage"},
@ -59,6 +61,9 @@ var LanguagesByExtension = map[string][]string{
".angelscript": {"AngelScript"}, ".angelscript": {"AngelScript"},
".anim": {"Unity3D Asset"}, ".anim": {"Unity3D Asset"},
".ant": {"XML"}, ".ant": {"XML"},
".antlers.html": {"Antlers"},
".antlers.php": {"Antlers"},
".antlers.xml": {"Antlers"},
".apacheconf": {"ApacheConf"}, ".apacheconf": {"ApacheConf"},
".apib": {"API Blueprint"}, ".apib": {"API Blueprint"},
".apl": {"APL"}, ".apl": {"APL"},
@ -106,7 +111,7 @@ var LanguagesByExtension = map[string][]string{
".bash": {"Shell"}, ".bash": {"Shell"},
".bat": {"Batchfile"}, ".bat": {"Batchfile"},
".bats": {"Shell"}, ".bats": {"Shell"},
".bb": {"BitBake", "BlitzBasic"}, ".bb": {"BitBake", "BlitzBasic", "Clojure"},
".bbx": {"TeX"}, ".bbx": {"TeX"},
".bdf": {"Glyph Bitmap Distribution Format"}, ".bdf": {"Glyph Bitmap Distribution Format"},
".bdy": {"PLSQL"}, ".bdy": {"PLSQL"},
@ -128,6 +133,7 @@ var LanguagesByExtension = map[string][]string{
".brd": {"Eagle", "KiCad Legacy Layout"}, ".brd": {"Eagle", "KiCad Legacy Layout"},
".bro": {"Zeek"}, ".bro": {"Zeek"},
".brs": {"Brightscript"}, ".brs": {"Brightscript"},
".bs": {"Bikeshed", "BrighterScript"},
".bsl": {"1C Enterprise"}, ".bsl": {"1C Enterprise"},
".bsv": {"Bluespec"}, ".bsv": {"Bluespec"},
".builder": {"Ruby"}, ".builder": {"Ruby"},
@ -151,6 +157,7 @@ var LanguagesByExtension = map[string][]string{
".ccxml": {"XML"}, ".ccxml": {"XML"},
".cdc": {"Cadence"}, ".cdc": {"Cadence"},
".cdf": {"Mathematica"}, ".cdf": {"Mathematica"},
".cds": {"CAP CDS"},
".ceylon": {"Ceylon"}, ".ceylon": {"Ceylon"},
".cfc": {"ColdFusion CFC"}, ".cfc": {"ColdFusion CFC"},
".cfg": {"HAProxy", "INI"}, ".cfg": {"HAProxy", "INI"},
@ -206,6 +213,7 @@ var LanguagesByExtension = map[string][]string{
".cpy": {"COBOL"}, ".cpy": {"COBOL"},
".cql": {"SQL"}, ".cql": {"SQL"},
".cr": {"Crystal"}, ".cr": {"Crystal"},
".crc32": {"Checksums"},
".creole": {"Creole"}, ".creole": {"Creole"},
".cs": {"C#", "Smalltalk"}, ".cs": {"C#", "Smalltalk"},
".csc": {"GSC"}, ".csc": {"GSC"},
@ -222,6 +230,7 @@ var LanguagesByExtension = map[string][]string{
".csx": {"C#"}, ".csx": {"C#"},
".ct": {"XML"}, ".ct": {"XML"},
".ctp": {"PHP"}, ".ctp": {"PHP"},
".cts": {"TypeScript"},
".cu": {"Cuda"}, ".cu": {"Cuda"},
".cue": {"CUE", "Cue Sheet"}, ".cue": {"CUE", "Cue Sheet"},
".cuh": {"Cuda"}, ".cuh": {"Cuda"},
@ -350,6 +359,7 @@ var LanguagesByExtension = map[string][]string{
".fsi": {"F#"}, ".fsi": {"F#"},
".fsproj": {"XML"}, ".fsproj": {"XML"},
".fst": {"F*"}, ".fst": {"F*"},
".fsti": {"F*"},
".fsx": {"F#"}, ".fsx": {"F#"},
".fth": {"Forth"}, ".fth": {"Forth"},
".ftl": {"Fluent", "FreeMarker"}, ".ftl": {"Fluent", "FreeMarker"},
@ -540,6 +550,7 @@ var LanguagesByExtension = map[string][]string{
".kak": {"KakouneScript"}, ".kak": {"KakouneScript"},
".kicad_mod": {"KiCad Layout"}, ".kicad_mod": {"KiCad Layout"},
".kicad_pcb": {"KiCad Layout"}, ".kicad_pcb": {"KiCad Layout"},
".kicad_sch": {"KiCad Schematic"},
".kicad_wks": {"KiCad Layout"}, ".kicad_wks": {"KiCad Layout"},
".kid": {"Genshi"}, ".kid": {"Genshi"},
".kit": {"Kit"}, ".kit": {"Kit"},
@ -579,6 +590,7 @@ var LanguagesByExtension = map[string][]string{
".liquid": {"Liquid"}, ".liquid": {"Liquid"},
".lisp": {"Common Lisp", "NewLisp"}, ".lisp": {"Common Lisp", "NewLisp"},
".litcoffee": {"Literate CoffeeScript"}, ".litcoffee": {"Literate CoffeeScript"},
".livemd": {"Markdown"},
".ll": {"LLVM"}, ".ll": {"LLVM"},
".lmi": {"Python"}, ".lmi": {"Python"},
".logtalk": {"Logtalk"}, ".logtalk": {"Logtalk"},
@ -591,6 +603,7 @@ var LanguagesByExtension = map[string][]string{
".lsp": {"Common Lisp", "NewLisp"}, ".lsp": {"Common Lisp", "NewLisp"},
".ltx": {"TeX"}, ".ltx": {"TeX"},
".lua": {"Lua"}, ".lua": {"Lua"},
".lvclass": {"LabVIEW"},
".lvlib": {"LabVIEW"}, ".lvlib": {"LabVIEW"},
".lvproj": {"LabVIEW"}, ".lvproj": {"LabVIEW"},
".ly": {"LilyPond"}, ".ly": {"LilyPond"},
@ -623,6 +636,9 @@ var LanguagesByExtension = map[string][]string{
".mcmeta": {"JSON"}, ".mcmeta": {"JSON"},
".mcr": {"MAXScript"}, ".mcr": {"MAXScript"},
".md": {"GCC Machine Description", "Markdown"}, ".md": {"GCC Machine Description", "Markdown"},
".md2": {"Checksums"},
".md4": {"Checksums"},
".md5": {"Checksums"},
".mdoc": {"Roff", "Roff Manpage"}, ".mdoc": {"Roff", "Roff Manpage"},
".mdown": {"Markdown"}, ".mdown": {"Markdown"},
".mdpolicy": {"XML"}, ".mdpolicy": {"XML"},
@ -664,16 +680,20 @@ var LanguagesByExtension = map[string][]string{
".monkey2": {"Monkey"}, ".monkey2": {"Monkey"},
".moo": {"Mercury", "Moocode"}, ".moo": {"Mercury", "Moocode"},
".moon": {"MoonScript"}, ".moon": {"MoonScript"},
".mpl": {"JetBrains MPS"},
".mps": {"JetBrains MPS"},
".mq4": {"MQL4"}, ".mq4": {"MQL4"},
".mq5": {"MQL5"}, ".mq5": {"MQL5"},
".mqh": {"MQL4", "MQL5"}, ".mqh": {"MQL4", "MQL5"},
".mrc": {"mIRC Script"}, ".mrc": {"mIRC Script"},
".ms": {"MAXScript", "Roff", "Unix Assembly"}, ".ms": {"MAXScript", "Roff", "Unix Assembly"},
".msd": {"JetBrains MPS"},
".mspec": {"Ruby"}, ".mspec": {"Ruby"},
".mss": {"CartoCSS"}, ".mss": {"CartoCSS"},
".mt": {"Mathematica"}, ".mt": {"Mathematica"},
".mtl": {"Wavefront Material"}, ".mtl": {"Wavefront Material"},
".mtml": {"MTML"}, ".mtml": {"MTML"},
".mts": {"TypeScript"},
".mu": {"mupad"}, ".mu": {"mupad"},
".mud": {"ZIL"}, ".mud": {"ZIL"},
".muf": {"MUF"}, ".muf": {"MUF"},
@ -819,6 +839,7 @@ var LanguagesByExtension = map[string][]string{
".podspec": {"Ruby"}, ".podspec": {"Ruby"},
".pogo": {"PogoScript"}, ".pogo": {"PogoScript"},
".pony": {"Pony"}, ".pony": {"Pony"},
".por": {"Portugol"},
".postcss": {"PostCSS"}, ".postcss": {"PostCSS"},
".pot": {"Gettext Catalog"}, ".pot": {"Gettext Catalog"},
".pov": {"POV-Ray SDL"}, ".pov": {"POV-Ray SDL"},
@ -978,6 +999,14 @@ var LanguagesByExtension = map[string][]string{
".sh": {"Shell"}, ".sh": {"Shell"},
".sh-session": {"ShellSession"}, ".sh-session": {"ShellSession"},
".sh.in": {"Shell"}, ".sh.in": {"Shell"},
".sha1": {"Checksums"},
".sha2": {"Checksums"},
".sha224": {"Checksums"},
".sha256": {"Checksums"},
".sha256sum": {"Checksums"},
".sha3": {"Checksums"},
".sha384": {"Checksums"},
".sha512": {"Checksums"},
".shader": {"GLSL", "ShaderLab"}, ".shader": {"GLSL", "ShaderLab"},
".shen": {"Shen"}, ".shen": {"Shen"},
".shproj": {"XML"}, ".shproj": {"XML"},
@ -1021,7 +1050,9 @@ var LanguagesByExtension = map[string][]string{
".sss": {"SugarSS"}, ".sss": {"SugarSS"},
".st": {"Smalltalk", "StringTemplate"}, ".st": {"Smalltalk", "StringTemplate"},
".stan": {"Stan"}, ".stan": {"Stan"},
".star": {"STAR", "Starlark"},
".sthlp": {"Stata"}, ".sthlp": {"Stata"},
".stl": {"STL"},
".ston": {"STON"}, ".ston": {"STON"},
".story": {"Gherkin"}, ".story": {"Gherkin"},
".storyboard": {"XML"}, ".storyboard": {"XML"},
@ -1166,6 +1197,7 @@ var LanguagesByExtension = map[string][]string{
".webidl": {"WebIDL"}, ".webidl": {"WebIDL"},
".webmanifest": {"JSON"}, ".webmanifest": {"JSON"},
".weechatlog": {"IRC log"}, ".weechatlog": {"IRC log"},
".whiley": {"Whiley"},
".wiki": {"Wikitext"}, ".wiki": {"Wikitext"},
".wikitext": {"Wikitext"}, ".wikitext": {"Wikitext"},
".wisp": {"wisp"}, ".wisp": {"wisp"},
@ -1245,6 +1277,7 @@ var LanguagesByExtension = map[string][]string{
".yml": {"YAML"}, ".yml": {"YAML"},
".yml.mysql": {"YAML"}, ".yml.mysql": {"YAML"},
".yrl": {"Erlang"}, ".yrl": {"Erlang"},
".yul": {"Yul"},
".yy": {"JSON", "Yacc"}, ".yy": {"JSON", "Yacc"},
".yyp": {"JSON"}, ".yyp": {"JSON"},
".zap": {"ZAP"}, ".zap": {"ZAP"},
@ -1287,6 +1320,7 @@ var ExtensionsByLanguage = map[string][]string{
"Alloy": {".als"}, "Alloy": {".als"},
"Altium Designer": {".outjob", ".pcbdoc", ".prjpcb", ".schdoc"}, "Altium Designer": {".outjob", ".pcbdoc", ".prjpcb", ".schdoc"},
"AngelScript": {".as", ".angelscript"}, "AngelScript": {".as", ".angelscript"},
"Antlers": {".antlers.html", ".antlers.php", ".antlers.xml"},
"ApacheConf": {".apacheconf", ".vhost"}, "ApacheConf": {".apacheconf", ".vhost"},
"Apex": {".cls"}, "Apex": {".cls"},
"Apollo Guidance Computer": {".agc"}, "Apollo Guidance Computer": {".agc"},
@ -1310,6 +1344,7 @@ var ExtensionsByLanguage = map[string][]string{
"Berry": {".be"}, "Berry": {".be"},
"BibTeX": {".bib", ".bibtex"}, "BibTeX": {".bib", ".bibtex"},
"Bicep": {".bicep"}, "Bicep": {".bicep"},
"Bikeshed": {".bs"},
"Bison": {".bison"}, "Bison": {".bison"},
"BitBake": {".bb"}, "BitBake": {".bb"},
"Blade": {".blade", ".blade.php"}, "Blade": {".blade", ".blade.php"},
@ -1319,12 +1354,14 @@ var ExtensionsByLanguage = map[string][]string{
"Boo": {".boo"}, "Boo": {".boo"},
"Boogie": {".bpl"}, "Boogie": {".bpl"},
"Brainfuck": {".b", ".bf"}, "Brainfuck": {".b", ".bf"},
"BrighterScript": {".bs"},
"Brightscript": {".brs"}, "Brightscript": {".brs"},
"C": {".c", ".cats", ".h", ".idc"}, "C": {".c", ".cats", ".h", ".idc"},
"C#": {".cs", ".cake", ".csx", ".linq"}, "C#": {".cs", ".cake", ".csx", ".linq"},
"C++": {".cpp", ".c++", ".cc", ".cp", ".cxx", ".h", ".h++", ".hh", ".hpp", ".hxx", ".inc", ".inl", ".ino", ".ipp", ".ixx", ".re", ".tcc", ".tpp"}, "C++": {".cpp", ".c++", ".cc", ".cp", ".cxx", ".h", ".h++", ".hh", ".hpp", ".hxx", ".inc", ".inl", ".ino", ".ipp", ".ixx", ".re", ".tcc", ".tpp"},
"C-ObjDump": {".c-objdump"}, "C-ObjDump": {".c-objdump"},
"C2hs Haskell": {".chs"}, "C2hs Haskell": {".chs"},
"CAP CDS": {".cds"},
"CIL": {".cil"}, "CIL": {".cil"},
"CLIPS": {".clp"}, "CLIPS": {".clp"},
"CMake": {".cmake", ".cmake.in"}, "CMake": {".cmake", ".cmake.in"},
@ -1344,6 +1381,7 @@ var ExtensionsByLanguage = map[string][]string{
"Ceylon": {".ceylon"}, "Ceylon": {".ceylon"},
"Chapel": {".chpl"}, "Chapel": {".chpl"},
"Charity": {".ch"}, "Charity": {".ch"},
"Checksums": {".crc32", ".md2", ".md4", ".md5", ".sha1", ".sha2", ".sha224", ".sha256", ".sha256sum", ".sha3", ".sha384", ".sha512"},
"ChucK": {".ck"}, "ChucK": {".ck"},
"Cirru": {".cirru"}, "Cirru": {".cirru"},
"Clarion": {".clw"}, "Clarion": {".clw"},
@ -1351,7 +1389,7 @@ var ExtensionsByLanguage = map[string][]string{
"Classic ASP": {".asp"}, "Classic ASP": {".asp"},
"Clean": {".icl", ".dcl"}, "Clean": {".icl", ".dcl"},
"Click": {".click"}, "Click": {".click"},
"Clojure": {".clj", ".boot", ".cl2", ".cljc", ".cljs", ".cljs.hl", ".cljscm", ".cljx", ".hic"}, "Clojure": {".clj", ".bb", ".boot", ".cl2", ".cljc", ".cljs", ".cljs.hl", ".cljscm", ".cljx", ".hic"},
"Closure Templates": {".soy"}, "Closure Templates": {".soy"},
"CoNLL-U": {".conllu", ".conll"}, "CoNLL-U": {".conllu", ".conll"},
"CodeQL": {".ql", ".qll"}, "CodeQL": {".ql", ".qll"},
@ -1411,7 +1449,7 @@ var ExtensionsByLanguage = map[string][]string{
"Erlang": {".erl", ".app.src", ".es", ".escript", ".hrl", ".xrl", ".yrl"}, "Erlang": {".erl", ".app.src", ".es", ".escript", ".hrl", ".xrl", ".yrl"},
"Euphoria": {".e", ".ex"}, "Euphoria": {".e", ".ex"},
"F#": {".fs", ".fsi", ".fsx"}, "F#": {".fs", ".fsi", ".fsx"},
"F*": {".fst"}, "F*": {".fst", ".fsti"},
"FIGlet Font": {".flf"}, "FIGlet Font": {".flf"},
"FLUX": {".fx", ".flux"}, "FLUX": {".fx", ".flux"},
"Factor": {".factor"}, "Factor": {".factor"},
@ -1502,7 +1540,7 @@ var ExtensionsByLanguage = map[string][]string{
"Isabelle": {".thy"}, "Isabelle": {".thy"},
"J": {".ijs"}, "J": {".ijs"},
"JFlex": {".flex", ".jflex"}, "JFlex": {".flex", ".jflex"},
"JSON": {".json", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".json-tmlanguage", ".jsonl", ".mcmeta", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"}, "JSON": {".json", ".4dform", ".4dproject", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".json-tmlanguage", ".jsonl", ".mcmeta", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"},
"JSON with Comments": {".jsonc", ".code-snippets", ".sublime-build", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"}, "JSON with Comments": {".jsonc", ".code-snippets", ".sublime-build", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"},
"JSON5": {".json5"}, "JSON5": {".json5"},
"JSONLD": {".jsonld"}, "JSONLD": {".jsonld"},
@ -1515,6 +1553,7 @@ var ExtensionsByLanguage = map[string][]string{
"JavaScript": {".js", "._js", ".bones", ".cjs", ".es", ".es6", ".frag", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".jsx", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib"}, "JavaScript": {".js", "._js", ".bones", ".cjs", ".es", ".es6", ".frag", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".jsx", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib"},
"JavaScript+ERB": {".js.erb"}, "JavaScript+ERB": {".js.erb"},
"Jest Snapshot": {".snap"}, "Jest Snapshot": {".snap"},
"JetBrains MPS": {".mps", ".mpl", ".msd"},
"Jinja": {".jinja", ".j2", ".jinja2"}, "Jinja": {".jinja", ".j2", ".jinja2"},
"Jison": {".jison"}, "Jison": {".jison"},
"Jison Lex": {".jisonlex"}, "Jison Lex": {".jisonlex"},
@ -1527,7 +1566,7 @@ var ExtensionsByLanguage = map[string][]string{
"KakouneScript": {".kak"}, "KakouneScript": {".kak"},
"KiCad Layout": {".kicad_pcb", ".kicad_mod", ".kicad_wks"}, "KiCad Layout": {".kicad_pcb", ".kicad_mod", ".kicad_wks"},
"KiCad Legacy Layout": {".brd"}, "KiCad Legacy Layout": {".brd"},
"KiCad Schematic": {".sch"}, "KiCad Schematic": {".kicad_sch", ".sch"},
"Kit": {".kit"}, "Kit": {".kit"},
"Kotlin": {".kt", ".ktm", ".kts"}, "Kotlin": {".kt", ".ktm", ".kts"},
"Kusto": {".csl"}, "Kusto": {".csl"},
@ -1536,7 +1575,7 @@ var ExtensionsByLanguage = map[string][]string{
"LOLCODE": {".lol"}, "LOLCODE": {".lol"},
"LSL": {".lsl", ".lslp"}, "LSL": {".lsl", ".lslp"},
"LTspice Symbol": {".asy"}, "LTspice Symbol": {".asy"},
"LabVIEW": {".lvproj", ".lvlib"}, "LabVIEW": {".lvproj", ".lvclass", ".lvlib"},
"Lark": {".lark"}, "Lark": {".lark"},
"Lasso": {".lasso", ".las", ".lasso8", ".lasso9"}, "Lasso": {".lasso", ".las", ".lasso8", ".lasso9"},
"Latte": {".latte"}, "Latte": {".latte"},
@ -1571,7 +1610,7 @@ var ExtensionsByLanguage = map[string][]string{
"Macaulay2": {".m2"}, "Macaulay2": {".m2"},
"Makefile": {".mak", ".d", ".make", ".makefile", ".mk", ".mkfile"}, "Makefile": {".mak", ".d", ".make", ".makefile", ".mk", ".mkfile"},
"Mako": {".mako", ".mao"}, "Mako": {".mako", ".mao"},
"Markdown": {".md", ".markdown", ".mdown", ".mdwn", ".mdx", ".mkd", ".mkdn", ".mkdown", ".ronn", ".scd", ".workbook"}, "Markdown": {".md", ".livemd", ".markdown", ".mdown", ".mdwn", ".mdx", ".mkd", ".mkdn", ".mkdown", ".ronn", ".scd", ".workbook"},
"Marko": {".marko"}, "Marko": {".marko"},
"Mask": {".mask"}, "Mask": {".mask"},
"Mathematica": {".mathematica", ".cdf", ".m", ".ma", ".mt", ".nb", ".nbp", ".wl", ".wlt"}, "Mathematica": {".mathematica", ".cdf", ".m", ".ma", ".mt", ".nb", ".nbp", ".wl", ".wlt"},
@ -1665,6 +1704,7 @@ var ExtensionsByLanguage = map[string][]string{
"Pod 6": {".pod", ".pod6"}, "Pod 6": {".pod", ".pod6"},
"PogoScript": {".pogo"}, "PogoScript": {".pogo"},
"Pony": {".pony"}, "Pony": {".pony"},
"Portugol": {".por"},
"PostCSS": {".pcss", ".postcss"}, "PostCSS": {".pcss", ".postcss"},
"PostScript": {".ps", ".eps", ".epsi", ".pfa"}, "PostScript": {".ps", ".eps", ".epsi", ".pfa"},
"PowerBuilder": {".pbt", ".sra", ".sru", ".srw"}, "PowerBuilder": {".pbt", ".sra", ".sru", ".srw"},
@ -1731,6 +1771,8 @@ var ExtensionsByLanguage = map[string][]string{
"SQL": {".sql", ".cql", ".ddl", ".inc", ".mysql", ".prc", ".tab", ".udf", ".viw"}, "SQL": {".sql", ".cql", ".ddl", ".inc", ".mysql", ".prc", ".tab", ".udf", ".viw"},
"SQLPL": {".sql", ".db2"}, "SQLPL": {".sql", ".db2"},
"SRecode Template": {".srt"}, "SRecode Template": {".srt"},
"STAR": {".star"},
"STL": {".stl"},
"STON": {".ston"}, "STON": {".ston"},
"SVG": {".svg"}, "SVG": {".svg"},
"SWIG": {".i"}, "SWIG": {".i"},
@ -1760,7 +1802,7 @@ var ExtensionsByLanguage = map[string][]string{
"Squirrel": {".nut"}, "Squirrel": {".nut"},
"Stan": {".stan"}, "Stan": {".stan"},
"Standard ML": {".ml", ".fun", ".sig", ".sml"}, "Standard ML": {".ml", ".fun", ".sig", ".sml"},
"Starlark": {".bzl"}, "Starlark": {".bzl", ".star"},
"Stata": {".do", ".ado", ".doh", ".ihlp", ".mata", ".matah", ".sthlp"}, "Stata": {".do", ".ado", ".doh", ".ihlp", ".mata", ".matah", ".sthlp"},
"StringTemplate": {".st"}, "StringTemplate": {".st"},
"Stylus": {".styl"}, "Stylus": {".styl"},
@ -1791,7 +1833,7 @@ var ExtensionsByLanguage = map[string][]string{
"Turtle": {".ttl"}, "Turtle": {".ttl"},
"Twig": {".twig"}, "Twig": {".twig"},
"Type Language": {".tl"}, "Type Language": {".tl"},
"TypeScript": {".ts"}, "TypeScript": {".ts", ".cts", ".mts"},
"Unified Parallel C": {".upc"}, "Unified Parallel C": {".upc"},
"Unity3D Asset": {".anim", ".asset", ".mask", ".mat", ".meta", ".prefab", ".unity"}, "Unity3D Asset": {".anim", ".asset", ".mask", ".mat", ".meta", ".prefab", ".unity"},
"Unix Assembly": {".s", ".ms"}, "Unix Assembly": {".s", ".ms"},
@ -1819,6 +1861,7 @@ var ExtensionsByLanguage = map[string][]string{
"WebAssembly": {".wast", ".wat"}, "WebAssembly": {".wast", ".wat"},
"WebIDL": {".webidl"}, "WebIDL": {".webidl"},
"WebVTT": {".vtt"}, "WebVTT": {".vtt"},
"Whiley": {".whiley"},
"Wikitext": {".mediawiki", ".wiki", ".wikitext"}, "Wikitext": {".mediawiki", ".wiki", ".wikitext"},
"Win32 Message File": {".mc"}, "Win32 Message File": {".mc"},
"Windows Registry Entries": {".reg"}, "Windows Registry Entries": {".reg"},
@ -1844,6 +1887,7 @@ var ExtensionsByLanguage = map[string][]string{
"YARA": {".yar", ".yara"}, "YARA": {".yar", ".yara"},
"YASnippet": {".yasnippet"}, "YASnippet": {".yasnippet"},
"Yacc": {".y", ".yacc", ".yy"}, "Yacc": {".y", ".yacc", ".yy"},
"Yul": {".yul"},
"ZAP": {".zap", ".xzap"}, "ZAP": {".zap", ".xzap"},
"ZIL": {".zil", ".mud"}, "ZIL": {".zil", ".mud"},
"Zeek": {".zeek", ".bro"}, "Zeek": {".zeek", ".bro"},

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -24,10 +24,12 @@ var LanguagesByFilename = map[string][]string{
".clang-tidy": {"YAML"}, ".clang-tidy": {"YAML"},
".classpath": {"XML"}, ".classpath": {"XML"},
".coffeelintignore": {"Ignore List"}, ".coffeelintignore": {"Ignore List"},
".coveragerc": {"INI"},
".cproject": {"XML"}, ".cproject": {"XML"},
".cshrc": {"Shell"}, ".cshrc": {"Shell"},
".curlrc": {"cURL Config"}, ".curlrc": {"cURL Config"},
".cvsignore": {"Ignore List"}, ".cvsignore": {"Ignore List"},
".devcontainer.json": {"JSON with Comments"},
".dir_colors": {"dircolors"}, ".dir_colors": {"dircolors"},
".dircolors": {"dircolors"}, ".dircolors": {"dircolors"},
".dockerignore": {"Ignore List"}, ".dockerignore": {"Ignore List"},
@ -46,6 +48,7 @@ var LanguagesByFilename = map[string][]string{
".flaskenv": {"Shell"}, ".flaskenv": {"Shell"},
".gclient": {"Python"}, ".gclient": {"Python"},
".gemrc": {"YAML"}, ".gemrc": {"YAML"},
".git-blame-ignore-revs": {"Git Revision List"},
".gitattributes": {"Git Attributes"}, ".gitattributes": {"Git Attributes"},
".gitconfig": {"Git Config"}, ".gitconfig": {"Git Config"},
".gitignore": {"Ignore List"}, ".gitignore": {"Ignore List"},
@ -78,6 +81,7 @@ var LanguagesByFilename = map[string][]string{
".profile": {"Shell"}, ".profile": {"Shell"},
".project": {"XML"}, ".project": {"XML"},
".pryrc": {"Ruby"}, ".pryrc": {"Ruby"},
".pylintrc": {"INI"},
".shellcheckrc": {"ShellCheck Config"}, ".shellcheckrc": {"ShellCheck Config"},
".simplecov": {"Ruby"}, ".simplecov": {"Ruby"},
".spacemacs": {"Emacs Lisp"}, ".spacemacs": {"Emacs Lisp"},
@ -146,6 +150,7 @@ var LanguagesByFilename = map[string][]string{
"LICENSE.mysql": {"Text"}, "LICENSE.mysql": {"Text"},
"Lexer.x": {"Lex"}, "Lexer.x": {"Lex"},
"MANIFEST.MF": {"JAR Manifest"}, "MANIFEST.MF": {"JAR Manifest"},
"MD5SUMS": {"Checksums"},
"Makefile": {"Makefile"}, "Makefile": {"Makefile"},
"Makefile.PL": {"Perl"}, "Makefile.PL": {"Perl"},
"Makefile.am": {"Makefile"}, "Makefile.am": {"Makefile"},
@ -176,6 +181,10 @@ var LanguagesByFilename = map[string][]string{
"Rexfile": {"Perl"}, "Rexfile": {"Perl"},
"SConscript": {"Python"}, "SConscript": {"Python"},
"SConstruct": {"Python"}, "SConstruct": {"Python"},
"SHA1SUMS": {"Checksums"},
"SHA256SUMS": {"Checksums"},
"SHA256SUMS.txt": {"Checksums"},
"SHA512SUMS": {"Checksums"},
"Settings.StyleCop": {"XML"}, "Settings.StyleCop": {"XML"},
"Singularity": {"Singularity"}, "Singularity": {"Singularity"},
"Slakefile": {"LiveScript"}, "Slakefile": {"LiveScript"},
@ -211,6 +220,8 @@ var LanguagesByFilename = map[string][]string{
"buildozer.spec": {"INI"}, "buildozer.spec": {"INI"},
"cabal.config": {"Cabal Config"}, "cabal.config": {"Cabal Config"},
"cabal.project": {"Cabal Config"}, "cabal.project": {"Cabal Config"},
"checksums.txt": {"Checksums"},
"cksums": {"Checksums"},
"click.me": {"Text"}, "click.me": {"Text"},
"composer.lock": {"JSON"}, "composer.lock": {"JSON"},
"configure.ac": {"M4Sugar"}, "configure.ac": {"M4Sugar"},
@ -259,6 +270,7 @@ var LanguagesByFilename = map[string][]string{
"makefile.sco": {"Makefile"}, "makefile.sco": {"Makefile"},
"man": {"Shell"}, "man": {"Shell"},
"mcmod.info": {"JSON"}, "mcmod.info": {"JSON"},
"md5sum.txt": {"Checksums"},
"meson.build": {"Meson"}, "meson.build": {"Meson"},
"meson_options.txt": {"Meson"}, "meson_options.txt": {"Meson"},
"mix.lock": {"Elixir"}, "mix.lock": {"Elixir"},
@ -279,6 +291,7 @@ var LanguagesByFilename = map[string][]string{
"pom.xml": {"Maven POM"}, "pom.xml": {"Maven POM"},
"port_contexts": {"SELinux Policy"}, "port_contexts": {"SELinux Policy"},
"profile": {"Shell"}, "profile": {"Shell"},
"pylintrc": {"INI"},
"read.me": {"Text"}, "read.me": {"Text"},
"readme.1st": {"Text"}, "readme.1st": {"Text"},
"rebar.config": {"Erlang"}, "rebar.config": {"Erlang"},

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -13,6 +13,7 @@ var LanguagesByInterpreter = map[string][]string{
"asy": {"Asymptote"}, "asy": {"Asymptote"},
"awk": {"Awk"}, "awk": {"Awk"},
"bash": {"Shell"}, "bash": {"Shell"},
"bb": {"Clojure"},
"bigloo": {"Scheme"}, "bigloo": {"Scheme"},
"boogie": {"Boogie"}, "boogie": {"Boogie"},
"boolector": {"SMT"}, "boolector": {"SMT"},

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -16,6 +16,7 @@ var LanguagesMime = map[string]string{
"Asymptote": "text/x-kotlin", "Asymptote": "text/x-kotlin",
"Beef": "text/x-csharp", "Beef": "text/x-csharp",
"BibTeX": "text/x-stex", "BibTeX": "text/x-stex",
"Bikeshed": "text/html",
"Brainfuck": "text/x-brainfuck", "Brainfuck": "text/x-brainfuck",
"C": "text/x-csrc", "C": "text/x-csrc",
"C#": "text/x-csharp", "C#": "text/x-csharp",
@ -111,6 +112,7 @@ var LanguagesMime = map[string]string{
"JavaScript": "text/javascript", "JavaScript": "text/javascript",
"JavaScript+ERB": "application/javascript", "JavaScript+ERB": "application/javascript",
"Jest Snapshot": "application/javascript", "Jest Snapshot": "application/javascript",
"JetBrains MPS": "text/xml",
"Jinja": "text/x-django", "Jinja": "text/x-django",
"Julia": "text/x-julia", "Julia": "text/x-julia",
"Jupyter Notebook": "application/json", "Jupyter Notebook": "application/json",

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -72,6 +72,7 @@ var LanguagesType = map[string]int{
"Altium Designer": 1, "Altium Designer": 1,
"AngelScript": 2, "AngelScript": 2,
"Ant Build System": 1, "Ant Build System": 1,
"Antlers": 3,
"ApacheConf": 1, "ApacheConf": 1,
"Apex": 2, "Apex": 2,
"Apollo Guidance Computer": 2, "Apollo Guidance Computer": 2,
@ -95,6 +96,7 @@ var LanguagesType = map[string]int{
"Berry": 2, "Berry": 2,
"BibTeX": 3, "BibTeX": 3,
"Bicep": 2, "Bicep": 2,
"Bikeshed": 3,
"Bison": 2, "Bison": 2,
"BitBake": 2, "BitBake": 2,
"Blade": 3, "Blade": 3,
@ -104,6 +106,7 @@ var LanguagesType = map[string]int{
"Boo": 2, "Boo": 2,
"Boogie": 2, "Boogie": 2,
"Brainfuck": 2, "Brainfuck": 2,
"BrighterScript": 2,
"Brightscript": 2, "Brightscript": 2,
"Browserslist": 1, "Browserslist": 1,
"C": 2, "C": 2,
@ -111,6 +114,7 @@ var LanguagesType = map[string]int{
"C++": 2, "C++": 2,
"C-ObjDump": 1, "C-ObjDump": 1,
"C2hs Haskell": 2, "C2hs Haskell": 2,
"CAP CDS": 2,
"CIL": 1, "CIL": 1,
"CLIPS": 2, "CLIPS": 2,
"CMake": 2, "CMake": 2,
@ -131,6 +135,7 @@ var LanguagesType = map[string]int{
"Ceylon": 2, "Ceylon": 2,
"Chapel": 2, "Chapel": 2,
"Charity": 2, "Charity": 2,
"Checksums": 1,
"ChucK": 2, "ChucK": 2,
"Cirru": 2, "Cirru": 2,
"Clarion": 2, "Clarion": 2,
@ -244,6 +249,7 @@ var LanguagesType = map[string]int{
"Gherkin": 2, "Gherkin": 2,
"Git Attributes": 1, "Git Attributes": 1,
"Git Config": 1, "Git Config": 1,
"Git Revision List": 1,
"Gleam": 2, "Gleam": 2,
"Glyph": 2, "Glyph": 2,
"Glyph Bitmap Distribution Format": 1, "Glyph Bitmap Distribution Format": 1,
@ -311,6 +317,7 @@ var LanguagesType = map[string]int{
"JavaScript": 2, "JavaScript": 2,
"JavaScript+ERB": 2, "JavaScript+ERB": 2,
"Jest Snapshot": 1, "Jest Snapshot": 1,
"JetBrains MPS": 2,
"Jinja": 3, "Jinja": 3,
"Jison": 2, "Jison": 2,
"Jison Lex": 2, "Jison Lex": 2,
@ -465,6 +472,7 @@ var LanguagesType = map[string]int{
"Pod 6": 4, "Pod 6": 4,
"PogoScript": 2, "PogoScript": 2,
"Pony": 2, "Pony": 2,
"Portugol": 2,
"PostCSS": 3, "PostCSS": 3,
"PostScript": 3, "PostScript": 3,
"PowerBuilder": 2, "PowerBuilder": 2,
@ -538,6 +546,8 @@ var LanguagesType = map[string]int{
"SQLPL": 2, "SQLPL": 2,
"SRecode Template": 3, "SRecode Template": 3,
"SSH Config": 1, "SSH Config": 1,
"STAR": 1,
"STL": 1,
"STON": 1, "STON": 1,
"SVG": 1, "SVG": 1,
"SWIG": 2, "SWIG": 2,
@ -631,6 +641,7 @@ var LanguagesType = map[string]int{
"WebIDL": 2, "WebIDL": 2,
"WebVTT": 1, "WebVTT": 1,
"Wget Config": 1, "Wget Config": 1,
"Whiley": 2,
"Wikitext": 4, "Wikitext": 4,
"Win32 Message File": 1, "Win32 Message File": 1,
"Windows Registry Entries": 1, "Windows Registry Entries": 1,
@ -658,6 +669,7 @@ var LanguagesType = map[string]int{
"YARA": 2, "YARA": 2,
"YASnippet": 3, "YASnippet": 3,
"Yacc": 2, "Yacc": 2,
"Yul": 2,
"ZAP": 2, "ZAP": 2,
"ZIL": 2, "ZIL": 2,
"Zeek": 2, "Zeek": 2,

View File

@ -1,5 +1,5 @@
// Code generated by github.com/go-enry/go-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: 4ffcdbcbb60a74cbfbd37656bcc3fcea4eca8e26 // Extracted from github/linguist commit: d7799da826e01acdb8f84694d33116dccaabe9c2
package data package data
@ -171,4 +171,8 @@ var VendorMatchers = []regex.EnryRegexp{
regex.MustCompile(`(^|/)\.google_apis/`), regex.MustCompile(`(^|/)\.google_apis/`),
regex.MustCompile(`(^|/)Jenkinsfile$`), regex.MustCompile(`(^|/)Jenkinsfile$`),
regex.MustCompile(`(^|/)\.gitpod\.Dockerfile$`), regex.MustCompile(`(^|/)\.gitpod\.Dockerfile$`),
regex.MustCompile(`(^|/)\.github/`),
} }
// FastVendorMatcher is equivalent to matching any of the VendorMatchers.
var FastVendorMatcher = regex.MustCompile(`(?:^(?:(?:[Dd]ependencies/)|(?:debian/)|(?:deps/)|(?:rebar$)))|(?:(?:^|/)(?:(?:BuddyBuildSDK\.framework/)|(?:Carthage/)|(?:Chart\.js$)|(?:Control\.FullScreen\.css)|(?:Control\.FullScreen\.js)|(?:Crashlytics\.framework/)|(?:Fabric\.framework/)|(?:Godeps/_workspace/)|(?:Jenkinsfile$)|(?:Leaflet\.Coordinates-\d+\.\d+\.\d+\.src\.js$)|(?:MathJax/)|(?:MochiKit\.js$)|(?:RealmSwift\.framework)|(?:Realm\.framework)|(?:Sparkle/)|(?:Vagrantfile$)|(?:[Bb]ourbon/.*\.(css|less|scss|styl)$)|(?:[Cc]ode[Mm]irror/(\d+\.\d+/)?(lib|mode|theme|addon|keymap|demo))|(?:[Ee]xtern(als?)?/)|(?:[Mm]icrosoft([Mm]vc)?([Aa]jax|[Vv]alidation)(\.debug)?\.js$)|(?:[Pp]ackages\/.+\.\d+\/)|(?:[Ss]pecs?/fixtures/)|(?:[Tt]ests?/fixtures/)|(?:[Vv]+endor/)|(?:\.[Dd][Ss]_[Ss]tore$)|(?:\.gitattributes$)|(?:\.github/)|(?:\.gitignore$)|(?:\.gitmodules$)|(?:\.gitpod\.Dockerfile$)|(?:\.google_apis/)|(?:\.indent\.pro)|(?:\.mvn/wrapper/)|(?:\.osx$)|(?:\.sublime-project)|(?:\.sublime-workspace)|(?:\.vscode/)|(?:\.yarn/plugins/)|(?:\.yarn/releases/)|(?:\.yarn/sdks/)|(?:\.yarn/unplugged/)|(?:\.yarn/versions/)|(?:_esy$)|(?:ace-builds/)|(?:aclocal\.m4)|(?:activator$)|(?:activator\.bat$)|(?:admin_media/)|(?:angular([^.]*)\.js$)|(?:animate\.(css|less|scss|styl)$)|(?:bootbox\.js)|(?:bootstrap([^/.]*)\.(js|css|less|scss|styl)$)|(?:bootstrap-datepicker/)|(?:bower_components/)|(?:bulma\.(css|sass|scss)$)|(?:cache/)|(?:ckeditor\.js$)|(?:config\.guess$)|(?:config\.sub$)|(?:configure$)|(?:controls\.js$)|(?:cordova([^.]*)\.js$)|(?:cordova\-\d\.\d(\.\d)?\.js$)|(?:cpplint\.py)|(?:custom\.bootstrap([^\s]*)(js|css|less|scss|styl)$)|(?:dist/)|(?:docs?/_?(build|themes?|templates?|static)/)|(?:dojo\.js$)|(?:dotnet-install\.(ps1|sh)$)|(?:dragdrop\.js$)|(?:effects\.js$)|(?:env/)|(?:erlang\.mk)|(?:extjs/.*?\.html$)|(?:extjs/.*?\.js$)|(?:extjs/.*?\.properties$)|(?:extjs/.*?\.txt$)|(?:extjs/.*?\.xml$)|(?:extjs/\.sencha/)|(?:extjs/builds/)|(?:extjs/cmd/)|(?:extjs/docs/)|(?:extjs/examples/)|(?:extjs/locale/)|(?:extjs/packages/)|(?:extjs/plugins/)|(?:extjs/resources/)|(?:extjs/src/)|(?:extjs/welcome/)|(?:fabfile\.py$)|(?:flow-typed/.*\.js$)|(?:font-?awesome/.*\.(css|less|scss|styl)$)|(?:font-?awesome\.(css|less|scss|styl)$)|(?:fontello(.*?)\.css$)|(?:foundation(\..*)?\.js$)|(?:foundation\.(css|less|scss|styl)$)|(?:fuelux\.js)|(?:gradle/wrapper/)|(?:gradlew$)|(?:gradlew\.bat$)|(?:html5shiv\.js$)|(?:inst/extdata/)|(?:jquery([^.]*)\.js$)|(?:jquery([^.]*)\.unobtrusive\-ajax\.js$)|(?:jquery([^.]*)\.validate(\.unobtrusive)?\.js$)|(?:jquery\-\d\.\d+(\.\d+)?\.js$)|(?:jquery\-ui(\-\d\.\d+(\.\d+)?)?(\.\w+)?\.(js|css)$)|(?:jquery\.(ui|effects)\.([^.]*)\.(js|css)$)|(?:jquery\.dataTables\.js)|(?:jquery\.fancybox\.(js|css))|(?:jquery\.fileupload(-\w+)?\.js$)|(?:jquery\.fn\.gantt\.js)|(?:knockout-(\d+\.){3}(debug\.)?js$)|(?:leaflet\.draw-src\.js)|(?:leaflet\.draw\.css)|(?:leaflet\.spin\.js)|(?:libtool\.m4)|(?:ltoptions\.m4)|(?:ltsugar\.m4)|(?:ltversion\.m4)|(?:lt~obsolete\.m4)|(?:materialize\.(css|less|scss|styl|js)$)|(?:modernizr\-\d\.\d+(\.\d+)?\.js$)|(?:modernizr\.custom\.\d+\.js$)|(?:mootools([^.]*)\d+\.\d+.\d+([^.]*)\.js$)|(?:mvnw$)|(?:mvnw\.cmd$)|(?:node_modules/)|(?:normalize\.(css|less|scss|styl)$)|(?:octicons\.css)|(?:pdf\.worker\.js)|(?:proguard-rules\.pro$)|(?:proguard\.pro$)|(?:prototype(.*)\.js$)|(?:puphpet/)|(?:react(-[^.]*)?\.js$)|(?:run\.n$)|(?:select2/.*\.(css|scss|js)$)|(?:shBrush([^.]*)\.js$)|(?:shCore\.js$)|(?:shLegacy\.js$)|(?:skeleton\.(css|less|scss|styl)$)|(?:slick\.\w+.js$)|(?:sprockets-octicons\.scss)|(?:testdata/)|(?:tiny_mce([^.]*)\.js$)|(?:tiny_mce/(langs|plugins|themes|utils))|(?:vendors?/)|(?:vignettes/)|(?:waf$)|(?:wicket-leaflet\.js)|(?:yahoo-([^.]*)\.js$)|(?:yui([^.]*)\.js$)))|(?:(.*?)\.d\.ts$)|(?:(3rd|[Tt]hird)[-_]?[Pp]arty/)|(?:([^\s]*)import\.(css|less|scss|styl)$)|(?:(\.|-)min\.(js|css)$)|(?:(^|\/)d3(\.v\d+)?([^.]*)\.js$)|(?:-vsdoc\.js$)|(?:\.imageset/)|(?:\.intellisense\.js$)|(?:\.xctemplate/)`)

View File

@ -2,8 +2,12 @@ package generator
import ( import (
"bytes" "bytes"
"fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"sort"
"strings"
"text/template"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
) )
@ -16,19 +20,97 @@ func Vendor(fileToParse, samplesDir, outPath, tmplPath, tmplName, commit string)
return err return err
} }
var regexpList []string var regexps []string
if err := yaml.Unmarshal(data, &regexpList); err != nil { if err := yaml.Unmarshal(data, &regexps); err != nil {
return nil return fmt.Errorf("failed to parse YAML %s, %q", fileToParse, err)
} }
buf := &bytes.Buffer{} buf := &bytes.Buffer{}
if err := executeVendorTemplate(buf, regexpList, tmplPath, tmplName, commit); err != nil { if err := executeVendorTemplate(buf, regexps, tmplPath, tmplName, commit); err != nil {
return nil return err
} }
return formatedWrite(outPath, buf.Bytes()) return formatedWrite(outPath, buf.Bytes())
} }
func executeVendorTemplate(out io.Writer, regexpList []string, tmplPath, tmplName, commit string) error { func executeVendorTemplate(out io.Writer, regexps []string, tmplPath, tmplName, commit string) error {
return executeTemplate(out, tmplName, tmplPath, commit, nil, regexpList) funcs := template.FuncMap{"optimize": collateAllMatchers}
return executeTemplate(out, tmplName, tmplPath, commit, funcs, regexps)
}
func collateAllMatchers(regexps []string) string {
// We now collate all regexps from VendorMatchers to a single large regexp
// which is at least twice as fast to test than simply iterating & matching.
//
// ---
//
// We could test each matcher from VendorMatchers in turn i.e.
//
// func IsVendor(filename string) bool {
// for _, matcher := range data.VendorMatchers {
// if matcher.MatchString(filename) {
// return true
// }
// }
// return false
// }
//
// Or naïvely concatentate all these regexps using groups i.e.
//
// `(regexp1)|(regexp2)|(regexp3)|...`
//
// However, both of these are relatively slow and don't take advantage
// of the inherent structure within our regexps.
//
// Imperical observation: by looking at the regexps, we only have 3 types.
// 1. Those that start with `^`
// 2. Those that start with `(^|/)`
// 3. All the rest
//
// If we collate our regexps into these 3 groups - that will significantly
// reduce the likelihood of backtracking within the regexp trie matcher.
//
// A further improvement is to use non-capturing groups (?:) as otherwise
// the regexp parser, whilst matching, will have to allocate slices for
// matching positions. (A future improvement left out could be to
// enforce non-capturing groups within the sub-regexps.)
const (
caret = "^"
caretOrSlash = "(^|/)"
)
sort.Strings(regexps)
var caretPrefixed, caretOrSlashPrefixed, theRest []string
// Check prefix, add to the respective group slices
for _, re := range regexps {
if strings.HasPrefix(re, caret) {
caretPrefixed = append(caretPrefixed, re[len(caret):])
} else if strings.HasPrefix(re, caretOrSlash) {
caretOrSlashPrefixed = append(caretOrSlashPrefixed, re[len(caretOrSlash):])
} else {
theRest = append(theRest, re)
}
}
var sb strings.Builder
appendGroupWithCommonPrefix(&sb, "^", caretPrefixed)
sb.WriteString("|")
appendGroupWithCommonPrefix(&sb, "(?:^|/)", caretOrSlashPrefixed)
sb.WriteString("|")
appendGroupWithCommonPrefix(&sb, "", theRest)
return sb.String()
}
func appendGroupWithCommonPrefix(sb *strings.Builder, commonPrefix string, res []string) {
sb.WriteString("(?:")
if commonPrefix != "" {
sb.WriteString(fmt.Sprintf("%s(?:(?:", commonPrefix))
}
sb.WriteString(strings.Join(res, ")|(?:"))
if commonPrefix != "" {
sb.WriteString("))")
}
sb.WriteString(")")
} }

View File

@ -134,7 +134,7 @@ func main() {
for _, file := range fileList { for _, file := range fileList {
if err := file.generate(file.fileToParse, file.samplesDir, file.outPath, file.tmplPath, file.tmplName, file.commit); err != nil { if err := file.generate(file.fileToParse, file.samplesDir, file.outPath, file.tmplPath, file.tmplName, file.commit); err != nil {
log.Printf("error generating template %q to %q: %+v", file.tmplPath, file.outPath, err) log.Fatalf("error generating template %q to %q: %+v", file.tmplPath, file.outPath, err)
} }
} }
} }

71
linguist_corpus_test.go Normal file
View File

@ -0,0 +1,71 @@
package enry
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/go-enry/go-enry/v2/data"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
)
type linguistCorpusSuite struct {
enryBaseTestSuite
}
func Test_EnryOnLinguistCorpus(t *testing.T) {
suite.Run(t, new(linguistCorpusSuite))
}
// First part of the test_blob.rb#test_language
// https://github.com/github/linguist/blob/59b2d88b2242e6062384e5fb876668cc30ead951/test/test_blob.rb#L258
func (s *linguistCorpusSuite) TestLinguistSamples() {
const filenamesDir = "filenames"
var cornerCases = map[string]bool{
"drop_stuff.sql": true, // https://github.com/src-d/enry/issues/194
"textobj-rubyblock.vba": true, // Because of unsupported negative lookahead RE syntax (https://github.com/github/linguist/blob/8083cb5a89cee2d99f5a988f165994d0243f0d1e/lib/linguist/heuristics.yml#L521)
// .es and .ice fail heuristics parsing, but do not fail any tests
}
var total, failed, ok, other int
var expected string
filepath.Walk(s.samplesDir, func(path string, f os.FileInfo, err error) error {
if f.IsDir() {
if f.Name() != filenamesDir {
expected, _ = data.LanguageByAlias(f.Name())
}
return nil
}
filename := filepath.Base(path)
content, _ := ioutil.ReadFile(path)
total++
obtained := GetLanguage(filename, content)
if obtained == OtherLanguage {
obtained = "Other"
other++
}
var status string
if expected == obtained {
status = "ok"
ok++
} else {
status = "failed"
failed++
}
if _, ok := cornerCases[filename]; ok {
s.T().Logf("\t\t[considered corner case] %s\texpected: %s\tobtained: %s\tstatus: %s\n", filename, expected, obtained, status)
} else {
assert.Equal(s.T(), expected, obtained, fmt.Sprintf("%s\texpected: %s\tobtained: %s\tstatus: %s\n", filename, expected, obtained, status))
}
return nil
})
s.T().Logf("\t\ttotal files: %d, ok: %d, failed: %d, other: %d\n", total, ok, failed, other)
}

135
utils.go
View File

@ -3,8 +3,6 @@ package enry
import ( import (
"bytes" "bytes"
"path/filepath" "path/filepath"
"regexp"
"sort"
"strings" "strings"
"github.com/go-enry/go-enry/v2/data" "github.com/go-enry/go-enry/v2/data"
@ -63,11 +61,9 @@ func IsDotFile(path string) bool {
return strings.HasPrefix(base, ".") && base != "." return strings.HasPrefix(base, ".") && base != "."
} }
var isVendorRegExp *regexp.Regexp
// IsVendor returns whether or not path is a vendor path. // IsVendor returns whether or not path is a vendor path.
func IsVendor(path string) bool { func IsVendor(path string) bool {
return isVendorRegExp.MatchString(path) return data.FastVendorMatcher.MatchString(path)
} }
// IsTest returns whether or not path is a test path. // IsTest returns whether or not path is a test path.
@ -75,6 +71,16 @@ func IsTest(path string) bool {
return matchRegexSlice(data.TestMatchers, path) return matchRegexSlice(data.TestMatchers, path)
} }
func matchRegexSlice(exprs []regex.EnryRegexp, str string) bool {
for _, expr := range exprs {
if expr.MatchString(str) {
return true
}
}
return false
}
// IsBinary detects if data is a binary value based on: // 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 // http://git.kernel.org/cgit/git/git.git/tree/xdiff-interface.c?id=HEAD#n198
func IsBinary(data []byte) bool { func IsBinary(data []byte) bool {
@ -102,16 +108,6 @@ func GetColor(language string) string {
return "#cccccc" return "#cccccc"
} }
func matchRegexSlice(exprs []regex.EnryRegexp, str string) bool {
for _, expr := range exprs {
if expr.MatchString(str) {
return true
}
}
return false
}
// IsGenerated returns whether the file with the given path and content is a // IsGenerated returns whether the file with the given path and content is a
// generated file. // generated file.
func IsGenerated(path string, content []byte) bool { func IsGenerated(path string, content []byte) bool {
@ -135,112 +131,3 @@ func IsGenerated(path string, content []byte) bool {
return false return false
} }
func init() {
// We now collate the individual regexps that make up the VendorMatchers to
// produce a single large regexp which is around twice as fast to test than
// simply iterating through all the regexps or naïvely collating the
// regexps.
//
// ---
//
// data.VendorMatchers here is a slice containing individual regexps that
// match a vendor file therefore if we want to test if a filename is a
// Vendor we need to test whether that filename matches one or more of
// those regexps.
//
// Now we could test each matcher in turn using a shortcircuiting test i.e.
//
// func IsVendor(filename string) bool {
// for _, matcher := range data.VendorMatchers {
// if matcher.Match(filename) {
// return true
// }
// }
// return false
// }
//
// Or concatenate all these regexps using groups i.e.
//
// `(regexp1)|(regexp2)|(regexp3)|...`
//
// However both of these are relatively slow and they don't take advantage
// of the inherent structure within our regexps...
//
// If we look at our regexps there are essentially three types of regexp:
//
// 1. Those that start with `^`
// 2. Those that start with `(^|/)`
// 3. Others
//
// If we collate our regexps into these groups that will significantly
// reduce the likelihood of backtracking within the regexp trie matcher.
//
// A further improvement is to use non-capturing groups as otherwise the
// regexp parser, whilst matching, will have to allocate slices for
// matching positions. (A future improvement here could be in the use of
// enforcing non-capturing groups within the sub-regexps too.)
//
// Finally if we sort the segments we can help the matcher build a more
// efficient matcher and trie.
// alias the VendorMatchers to simplify things
matchers := data.VendorMatchers
// Create three temporary string slices for our three groups above - prefixes removed
caretStrings := make([]string, 0, 10)
caretSegmentStrings := make([]string, 0, 10)
matcherStrings := make([]string, 0, len(matchers))
// Walk the matchers and check their string representation for each group prefix, remove it and add to the respective group slices
for _, matcher := range matchers {
str := matcher.String()
if str[0] == '^' {
caretStrings = append(caretStrings, str[1:])
} else if str[0:5] == "(^|/)" {
caretSegmentStrings = append(caretSegmentStrings, str[5:])
} else {
matcherStrings = append(matcherStrings, str)
}
}
// Sort the strings within each group - a potential further improvement could be in simplifying within these groups
sort.Strings(caretSegmentStrings)
sort.Strings(caretStrings)
sort.Strings(matcherStrings)
// Now build the collated regexp
sb := &strings.Builder{}
// Start with group 1 - those that started with `^`
sb.WriteString("(?:^(?:")
sb.WriteString(caretStrings[0])
for _, matcher := range caretStrings[1:] {
sb.WriteString(")|(?:")
sb.WriteString(matcher)
}
sb.WriteString("))")
sb.WriteString("|")
// Now add group 2 - those that started with `(^|/)`
sb.WriteString("(?:(?:^|/)(?:")
sb.WriteString(caretSegmentStrings[0])
for _, matcher := range caretSegmentStrings[1:] {
sb.WriteString(")|(?:")
sb.WriteString(matcher)
}
sb.WriteString("))")
sb.WriteString("|")
// Finally add the rest
sb.WriteString("(?:")
sb.WriteString(matcherStrings[0])
for _, matcher := range matcherStrings[1:] {
sb.WriteString(")|(?:")
sb.WriteString(matcher)
}
sb.WriteString(")")
// Compile the whole thing as the isVendorRegExp
isVendorRegExp = regexp.MustCompile(sb.String())
}

View File

@ -11,45 +11,53 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
//TODO(bzz): port all from test/test_file_blob.rb test_vendored()
//https://github.com/github/linguist/blob/86adc140d3e8903980565a2984f5532edf4ae875/test/test_file_blob.rb#L270-L583
var vendorTests = []struct {
path string
expected bool
}{
{"cache/", true},
{"something_cache/", false},
{"random/cache/", true},
{"cache", false},
{"dependencies/", true},
{"Dependencies/", true},
{"dependency/", false},
{"dist/", true},
{"dist", false},
{"random/dist/", true},
{"random/dist", false},
{"deps/", true},
{"foodeps/", false},
{"configure", true},
{"a/configure", true},
{"config.guess", true},
{"config.guess/", false},
{".vscode/", true},
{"doc/_build/", true},
{"a/docs/_build/", true},
{"a/dasdocs/_build-vsdoc.js", true},
{"a/dasdocs/_build-vsdoc.j", false},
{"foo/bar", false},
{".sublime-project", true},
{"foo/vendor/foo", true},
{"leaflet.draw-src.js", true},
{"foo/bar/MochiKit.js", true},
{"foo/bar/dojo.js", true},
{"foo/env/whatever", true},
{"some/python/venv/", false},
{"foo/.imageset/bar", true},
{"Vagrantfile", true},
{"src/bootstrap-custom.js", true},
// {"/css/bootstrap.rtl.css", true}, // from linguist v7.23
}
func TestIsVendor(t *testing.T) { func TestIsVendor(t *testing.T) {
tests := []struct { for _, tt := range vendorTests {
path string
expected bool
}{
{"cache/", true},
{"random/cache/", true},
{"cache", false},
{"dependencies/", true},
{"Dependencies/", true},
{"dependency/", false},
{"dist/", true},
{"dist", false},
{"random/dist/", true},
{"random/dist", false},
{"deps/", true},
{"configure", true},
{"a/configure", true},
{"config.guess", true},
{"config.guess/", false},
{".vscode/", true},
{"doc/_build/", true},
{"a/docs/_build/", true},
{"a/dasdocs/_build-vsdoc.js", true},
{"a/dasdocs/_build-vsdoc.j", false},
{"foo/bar", false},
{".sublime-project", true},
{"foo/vendor/foo", true},
{"leaflet.draw-src.js", true},
{"foo/bar/MochiKit.js", true},
{"foo/bar/dojo.js", true},
{"foo/env/whatever", true},
{"foo/.imageset/bar", true},
{"Vagrantfile", true},
}
for _, tt := range tests {
t.Run(tt.path, func(t *testing.T) { t.Run(tt.path, func(t *testing.T) {
if got := IsVendor(tt.path); got != tt.expected { if got := IsVendor(tt.path); got != tt.expected {
t.Errorf("IsVendor() = %v, expected %v", got, tt.expected) t.Errorf("IsVendor(%q) = %v, expected %v", tt.path, got, tt.expected)
} }
}) })
} }
@ -57,10 +65,9 @@ func TestIsVendor(t *testing.T) {
func BenchmarkIsVendor(b *testing.B) { func BenchmarkIsVendor(b *testing.B) {
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
IsVendor(".vscode/") for _, t := range vendorTests {
IsVendor("cache/") IsVendor(t.path)
IsVendor("foo/bar") }
IsVendor("foo/bar/MochiKit.js")
} }
} }