From 7e465897d4d2c6c7ba680c388db08301f037174b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Henrique=20Guard=C3=A3o=20Gandarez?= Date: Tue, 17 Sep 2024 11:10:30 -0300 Subject: [PATCH] Bump Chroma to v2.13.0 --- go.mod | 6 ++-- go.sum | 16 +++++------ pkg/heartbeat/language.go | 52 ++++++++++++++++++++++++++++------ pkg/heartbeat/language_test.go | 10 ++++++- 4 files changed, 64 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 03b93a1d..842da926 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.22.5 require ( github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 github.com/alecthomas/assert v1.0.0 - github.com/alecthomas/chroma/v2 v2.12.0 + github.com/alecthomas/chroma/v2 v2.13.0 github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 - github.com/dlclark/regexp2 v1.10.0 + github.com/dlclark/regexp2 v1.11.0 github.com/gandarez/go-olson-timezone v0.1.0 github.com/gandarez/go-realpath v1.0.0 github.com/juju/mutex v0.0.0-20180619145857-d21b13acf4bf @@ -30,7 +30,7 @@ require ( require ( github.com/alecthomas/colour v0.1.0 // indirect - github.com/alecthomas/repr v0.3.0 // indirect + github.com/alecthomas/repr v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect diff --git a/go.sum b/go.sum index ae3cd63e..867bdc83 100644 --- a/go.sum +++ b/go.sum @@ -42,14 +42,14 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/alecthomas/assert v1.0.0 h1:3XmGh/PSuLzDbK3W2gUbRXwgW5lqPkuqvRgeQ30FI5o= github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY= -github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink= -github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= -github.com/alecthomas/chroma/v2 v2.12.0 h1:Wh8qLEgMMsN7mgyG8/qIpegky2Hvzr4By6gEF7cmWgw= -github.com/alecthomas/chroma/v2 v2.12.0/go.mod h1:4TQu7gdfuPjSh76j78ietmqh9LiurGF0EpseFXdKMBw= +github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= +github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/chroma/v2 v2.13.0 h1:VP72+99Fb2zEcYM0MeaWJmV+xQvz5v5cxRHd+ooU1lI= +github.com/alecthomas/chroma/v2 v2.13.0/go.mod h1:BUGjjsD+ndS6eX37YgTchSEG+Jg9Jv1GiZs9sqPqztk= github.com/alecthomas/colour v0.1.0 h1:nOE9rJm6dsZ66RGWYSFrXw461ZIt9A6+nHgL7FRrDUk= github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= -github.com/alecthomas/repr v0.3.0 h1:NeYzUPfjjlqHY4KtzgKJiWd6sVq2eNUPTi34PiFGjY8= -github.com/alecthomas/repr v0.3.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= +github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -65,8 +65,8 @@ github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0= -github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= +github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= diff --git a/pkg/heartbeat/language.go b/pkg/heartbeat/language.go index 48c8051e..8d1dab6a 100644 --- a/pkg/heartbeat/language.go +++ b/pkg/heartbeat/language.go @@ -355,8 +355,8 @@ const ( LanguageDebianControlFile // LanguageDelphi represents the Delphi programming language. LanguageDelphi - // LanguageDesktop represents the desktop programming language. - LanguageDesktop + // LanguageDesktopFile represents the Desktop file programming language. + LanguageDesktopFile // LanguageDevicetree represents the Devicetree programming language. LanguageDevicetree // LanguageDG represents the DG programming language. @@ -867,6 +867,8 @@ const ( LanguageMask // LanguageMason represents the Mason programming language. LanguageMason + // LanguageMaterializeSQLDialect represents the Materialize SQL dialect programming language. + LanguageMaterializeSQLDialect // LanguageMathematica represents the Mathematica programming language. LanguageMathematica // LanguageMatlab represents the Matlab programming language. @@ -949,6 +951,8 @@ const ( LanguageNatural // LanguageNCL represents the NCL programming language. LanguageNCL + // LanguageNDISASM represents the NDISASM programming language. + LanguageNDISASM // LanguageNemerle represents the Nemerle programming language. LanguageNemerle // LanguageNeon represents the Neon programming language. @@ -1065,6 +1069,8 @@ const ( LanguageProcessing // LanguageProlog represents the Prolog programming language. LanguageProlog + // LanguagePromela represents the Promela programming language. + LanguagePromela // LanguagePromQL represents the PromQL programming language. LanguagePromQL // LanguageProtocolBuffer represents the ProtocolBuffer programming language. @@ -1139,14 +1145,16 @@ const ( LanguageRed // LanguageRedcode represents the Redcode programming language. LanguageRedcode + // LanguageRegistry represents the Registry programming language. + LanguageRegistry + // LanguageRego represents the Rego programming language. + LanguageRego // LanguageRegularExpression represents the RegularExpression programming language. LanguageRegularExpression // LanguageRenderScript represents the RenderScript programming language. LanguageRenderScript // LanguageRenPy represents the RenPy programming language. LanguageRenPy - // LanguageRegistry represents the Registry programming language. - LanguageRegistry // LanguageReScript represents the ReScript programming language. LanguageReScript // LanguageResourceBundle represents the ResourceBundle programming language. @@ -1757,6 +1765,8 @@ const ( languageDebianControlFileStr = "Debian Control file" languageDelphiStr = "Delphi" languageDesktopStr = "desktop" + languageDesktopEntryStr = "desktop_entry" + languageDesktopFileStr = "Desktop file" languageDevicetreeStr = "Devicetree" languageDGStr = "dg" languageDhallStr = "Dhall" @@ -2011,6 +2021,8 @@ const ( languageMarkoStr = "Marko" languageMaskStr = "Mask" languageMasonStr = "Mason" + languageMaterializeStr = "materialize" + languageMaterializeSQLDialectStr = "Materialize SQL dialect" languageMathematicaStr = "Mathematica" languageMatlabStr = "Matlab" languageMatlabSessionStr = "Matlab session" @@ -2048,10 +2060,12 @@ const ( languageMXMLStr = "MXML" languageMyghtyStr = "Myghty" languageMySQLStr = "MySQL" + languageMzqlStr = "mzql" languageNASMStr = "NASM" languageNASMObjdumpStr = "objdump-nasm" languageNaturalStr = "Natural" languageNCLStr = "NCL" + languageNDISASMStr = "NDISASM" languageNemerleStr = "Nemerle" languageNeonStr = "Neon" languageNesCStr = "nesC" @@ -2110,6 +2124,7 @@ const ( languagePraatStr = "Praat" languageProcessingStr = "Processing" languagePrologStr = "Prolog" + languagePromelaStr = "Promela" languagePromQLStr = "PromQL" languageProtocolBufferStr = "Protocol Buffer" languagePRQLStr = "PRQL" @@ -2148,6 +2163,7 @@ const ( languageRedStr = "Red" languageRedcodeStr = "Redcode" languageRegistryStr = "reg" + languageRegoStr = "Rego" languageRegularExpressionStr = "Regular Expression" languageRenderScriptStr = "RenderScript" languageRenPyStr = "Ren'Py" @@ -2774,8 +2790,10 @@ func ParseLanguage(s string) (Language, bool) { return LanguageDebianControlFile, true case normalizeString(languageDelphiStr): return LanguageDelphi, true - case normalizeString(languageDesktopStr): - return LanguageDesktop, true + case normalizeString(languageDesktopStr), + normalizeString(languageDesktopEntryStr), + normalizeString(languageDesktopFileStr): + return LanguageDesktopFile, true case normalizeString(languageDevicetreeStr): return LanguageDevicetree, true case normalizeString(languageDGStr): @@ -3284,6 +3302,10 @@ func ParseLanguage(s string) (Language, bool) { return LanguageMask, true case normalizeString(languageMasonStr): return LanguageMason, true + case normalizeString(languageMaterializeStr), + normalizeString(languageMaterializeSQLDialectStr), + normalizeString(languageMzqlStr): + return LanguageMaterializeSQLDialect, true case normalizeString(languageMathematicaStr): return LanguageMathematica, true case normalizeString(languageMatlabStr): @@ -3364,6 +3386,8 @@ func ParseLanguage(s string) (Language, bool) { return LanguageNatural, true case normalizeString(languageNCLStr): return LanguageNCL, true + case normalizeString(languageNDISASMStr): + return LanguageNDISASM, true case normalizeString(languageNemerleStr): return LanguageNemerle, true case normalizeString(languageNeonStr): @@ -3482,6 +3506,8 @@ func ParseLanguage(s string) (Language, bool) { return LanguageProcessing, true case normalizeString(languagePrologStr): return LanguageProlog, true + case normalizeString(languagePromelaStr): + return LanguagePromela, true case normalizeString(languagePromQLStr): return LanguagePromQL, true case normalizeString(languageProtocolBufferStr): @@ -3558,6 +3584,8 @@ func ParseLanguage(s string) (Language, bool) { return LanguageRedcode, true case normalizeString(languageRegistryStr): return LanguageRegistry, true + case normalizeString(languageRegoStr): + return LanguageRego, true case normalizeString(languageRegularExpressionStr): return LanguageRegularExpression, true case normalizeString(languageRenderScriptStr): @@ -4472,8 +4500,8 @@ func (l Language) String() string { return languageDebianControlFileStr case LanguageDelphi: return languageDelphiStr - case LanguageDesktop: - return languageDesktopStr + case LanguageDesktopFile: + return languageDesktopFileStr case LanguageDevicetree: return languageDevicetreeStr case LanguageDG: @@ -4978,6 +5006,8 @@ func (l Language) String() string { return languageMaskStr case LanguageMason: return languageMasonStr + case LanguageMaterializeSQLDialect: + return languageMaterializeSQLDialectStr case LanguageMathematica: return languageMathematicaStr case LanguageMatlab: @@ -5058,6 +5088,8 @@ func (l Language) String() string { return languageNaturalStr case LanguageNCL: return languageNCLStr + case LanguageNDISASM: + return languageNDISASMStr case LanguageNemerle: return languageNemerleStr case LanguageNeon: @@ -5178,6 +5210,8 @@ func (l Language) String() string { return languageProcessingStr case LanguageProlog: return languagePrologStr + case LanguagePromela: + return languagePromelaStr case LanguagePromQL: return languagePromQLStr case LanguageProtocolBuffer: @@ -5252,6 +5286,8 @@ func (l Language) String() string { return languageRedcodeStr case LanguageRegistry: return languageRegistryStr + case LanguageRego: + return languageRegoStr case LanguageRegularExpression: return languageRegularExpressionStr case LanguageRenderScript: diff --git a/pkg/heartbeat/language_test.go b/pkg/heartbeat/language_test.go index fa670e34..d606c724 100644 --- a/pkg/heartbeat/language_test.go +++ b/pkg/heartbeat/language_test.go @@ -188,7 +188,7 @@ func languageTests() map[string]heartbeat.Language { "Debian Control file": heartbeat.LanguageDebianControlFile, "Debian Sourcelist": heartbeat.LanguageSourcesList, "Delphi": heartbeat.LanguageDelphi, - "desktop": heartbeat.LanguageDesktop, + "Desktop file": heartbeat.LanguageDesktopFile, "Devicetree": heartbeat.LanguageDevicetree, "dg": heartbeat.LanguageDG, "Dhall": heartbeat.LanguageDhall, @@ -439,6 +439,7 @@ func languageTests() map[string]heartbeat.Language { "Marko": heartbeat.LanguageMarko, "Mask": heartbeat.LanguageMask, "Mason": heartbeat.LanguageMason, + "Materialize SQL dialect": heartbeat.LanguageMaterializeSQLDialect, "Mathematica": heartbeat.LanguageMathematica, "Matlab": heartbeat.LanguageMatlab, "Matlab session": heartbeat.LanguageMatlabSession, @@ -479,6 +480,7 @@ func languageTests() map[string]heartbeat.Language { "NASM": heartbeat.LanguageNASM, "Natural": heartbeat.LanguageNatural, "NCL": heartbeat.LanguageNCL, + "NDISASM": heartbeat.LanguageNDISASM, "Nemerle": heartbeat.LanguageNemerle, "Neon": heartbeat.LanguageNeon, "nesC": heartbeat.LanguageNesC, @@ -538,6 +540,7 @@ func languageTests() map[string]heartbeat.Language { "Praat": heartbeat.LanguagePraat, "Processing": heartbeat.LanguageProcessing, "Prolog": heartbeat.LanguageProlog, + "Promela": heartbeat.LanguagePromela, "PromQL": heartbeat.LanguagePromQL, "Property Specification Language": heartbeat.LanguagePSL, "Protocol Buffer": heartbeat.LanguageProtocolBuffer, @@ -575,6 +578,7 @@ func languageTests() map[string]heartbeat.Language { "Red": heartbeat.LanguageRed, "Redcode": heartbeat.LanguageRedcode, "reg": heartbeat.LanguageRegistry, + "Rego": heartbeat.LanguageRego, "Regular Expression": heartbeat.LanguageRegularExpression, "RenderScript": heartbeat.LanguageRenderScript, "Ren'Py": heartbeat.LanguageRenPy, @@ -796,9 +800,13 @@ func languageTestsAliases() map[string]heartbeat.Language { "ASP Classic": heartbeat.LanguageClassicASP, "Batch Script": heartbeat.LanguageBatchfile, "csharp": heartbeat.LanguageCSharp, + "desktop": heartbeat.LanguageDesktopFile, + "desktop_entry": heartbeat.LanguageDesktopFile, "FStar": heartbeat.LanguageFStar, "Golang": heartbeat.LanguageGo, "JSON-LD": heartbeat.LanguageJSONLD, + "materialize": heartbeat.LanguageMaterializeSQLDialect, + "mzql": heartbeat.LanguageMaterializeSQLDialect, "SaltStack": heartbeat.LanguageSalt, "Transact-SQL": heartbeat.LanguageTransactSQL, "Visual Basic .NET": heartbeat.LanguageVBNet,