From cd867186e63bc2f24dc098100ed9979bf4547123 Mon Sep 17 00:00:00 2001 From: leonace924 Date: Tue, 10 Feb 2026 20:41:02 -0500 Subject: [PATCH 1/2] fix(scoring): add ERB file scoring support Add .erb (Embedded Ruby) to programming_languages.json with weight 0.8 and to NON_CODE_EXTENSIONS for line-count scoring. No tree-sitter ERB parser exists in the language pack, so line-count is the only viable scoring method. Weight of 0.8 reflects ERB being a mix of HTML (0.75) and Ruby (1.75) template code. --- gittensor/constants.py | 3 ++- gittensor/validator/weights/programming_languages.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gittensor/constants.py b/gittensor/constants.py index 4686425..e2ee9d9 100644 --- a/gittensor/constants.py +++ b/gittensor/constants.py @@ -21,7 +21,7 @@ DEFAULT_PROGRAMMING_LANGUAGE_WEIGHT = 0.12 TEST_FILE_CONTRIBUTION_WEIGHT = 0.05 # Extensions that use line-count scoring (capped at MAX_LINES_SCORED_FOR_NON_CODE_EXT) -# These are documentation, config, or data files +# These are documentation, config, data files, or template languages without tree-sitter support NON_CODE_EXTENSIONS = [ 'md', 'mdx', @@ -45,6 +45,7 @@ 'config', 'properties', 'plist', + 'erb', ] MAX_LINES_SCORED_FOR_NON_CODE_EXT = 300 diff --git a/gittensor/validator/weights/programming_languages.json b/gittensor/validator/weights/programming_languages.json index 2ed4c73..0590991 100644 --- a/gittensor/validator/weights/programming_languages.json +++ b/gittensor/validator/weights/programming_languages.json @@ -28,6 +28,7 @@ "dockerfile": { "weight": 1.0, "language": "dockerfile" }, "elm": { "weight": 1.75, "language": "elm" }, "env": { "weight": 0.25 }, + "erb": { "weight": 0.8 }, "erl": { "weight": 1.5, "language": "erlang" }, "ex": { "weight": 1.5, "language": "elixir" }, "exs": { "weight": 1.5, "language": "elixir" }, From d65ede6b53cc5ee031103de6da6a3beaed6c191e Mon Sep 17 00:00:00 2001 From: leonace924 Date: Wed, 11 Feb 2026 22:44:18 -0500 Subject: [PATCH 2/2] fix: update the weight for erb --- gittensor/validator/weights/programming_languages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gittensor/validator/weights/programming_languages.json b/gittensor/validator/weights/programming_languages.json index 0590991..bfec788 100644 --- a/gittensor/validator/weights/programming_languages.json +++ b/gittensor/validator/weights/programming_languages.json @@ -28,7 +28,7 @@ "dockerfile": { "weight": 1.0, "language": "dockerfile" }, "elm": { "weight": 1.75, "language": "elm" }, "env": { "weight": 0.25 }, - "erb": { "weight": 0.8 }, + "erb": { "weight": 0.35 }, "erl": { "weight": 1.5, "language": "erlang" }, "ex": { "weight": 1.5, "language": "elixir" }, "exs": { "weight": 1.5, "language": "elixir" },