Skip to content

fix: route configured null-language extensions to line-count instead of skipped-unsupported (#1274)#1278

Open
alpurkan17 wants to merge 1 commit into
entrius:testfrom
alpurkan17:fix/1274-null-language-line-count
Open

fix: route configured null-language extensions to line-count instead of skipped-unsupported (#1274)#1278
alpurkan17 wants to merge 1 commit into
entrius:testfrom
alpurkan17:fix/1274-null-language-line-count

Conversation

@alpurkan17
Copy link
Copy Markdown
Contributor

Summary

Extensions in programming_languages.json with language=null (no tree-sitter parser) receive score=0.0 with scoring_method=skipped-unsupported. The scorer only routed to line-count when the extension appeared in NON_CODE_EXTENSIONS — it never consulted the JSON config for null-language entries.

Affected: env, gitattributes, gitignore, gql, graphql, ipynb, move, nim, pde, puml, tex (11 extensions).

Fix: add an inline check before the skipped-unsupported gate: when the extension is configured in programming_languages with language=None, route to line-count scoring using the configured weight.

No new method, no import changes, no architectural refactor — single inline check in the existing elif chain.

Changes

  • tree_sitter_scoring.py: add 11-line elif clause for null-language configs
  • test_token_scoring_integration.py: 6 test cases covering positive, negative, weight, regression, and config-coverage

Validation

  • ruff check: pass
  • ruff format: pass
  • pytest: 30/30 pass (24 existing + 6 new)
  • graphql → line-count with weight 1.0
  • .gitignore → line-count
  • unknown.xyz → still skipped-unsupported
  • test.py → still tree-diff (no regression)
  • All 11 null-language extensions verified via config-coverage test

vs PR #1275

PR #1275 This PR
Files 3 2
New API is_line_count_extension() method None
Import changes Remove NON_CODE_EXTENSIONS None
Approach Add method + refactor gate Inline elif check
Diff size +105/−2 +76

Closes #1274

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] configured null-language extensions score 0 (skipped-unsupported) instead of line-count

1 participant