fix: score extensionless configured files - #986
Merged
anderdc merged 10 commits intoMay 10, 2026
Conversation
…ESS_FILE_EXTENSIONS, drop removed GITHUB_DOMAIN
anderdc
requested changes
May 9, 2026
anderdc
left a comment
Collaborator
There was a problem hiding this comment.
Move _EXTENSIONLESS_FILE_EXTENSIONS to gittensor/constants.py alongside NON_CODE_EXTENSIONS — both are extension-keyed scoring config and should colocate. Import it from there in classes.py.
Contributor
Author
done |
anderdc
approved these changes
May 10, 2026
10 tasks
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Score configured extensionless files like
DockerfileandMakefile.FileChange._calculate_file_extension()previously returned an empty string for basenames without a dot. As a result, files such asDockerfile,dockerfile,Makefile, andmakefilecould not reach the configured tree-sitter scoring path, even thoughprogramming_languages.jsondefinesdockerfileandmakefile.This PR normalizes those configured extensionless basenames to their language config keys, while preserving existing behavior for normal dotted files and unrelated extensionless files.
Related Issues
Closes #985
Type of Change
Testing
Tests added/updated
Manually tested
./.venv/bin/pytest tests/test_classes.py::test_file_extension_handles_configured_extensionless_filenames tests/validator/test_token_scoring_integration.py::TestTreeDiffScoring::test_configured_extensionless_files_reach_tree_diff -q./.venv/bin/pytest tests/test_classes.py tests/validator/test_token_scoring_integration.py tests/validator/test_base_score.py -quv run pytest tests/ -quv run ruff checkuv run ruff format --checkuv run pyrightChecklist