Skip to content

fix: score extensionless configured files - #986

Merged
anderdc merged 10 commits into
entrius:testfrom
mkdev5:fix/issue-985-extensionless-configured-files
May 10, 2026
Merged

fix: score extensionless configured files#986
anderdc merged 10 commits into
entrius:testfrom
mkdev5:fix/issue-985-extensionless-configured-files

Conversation

@mkdev5

@mkdev5 mkdev5 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Score configured extensionless files like Dockerfile and Makefile.

FileChange._calculate_file_extension() previously returned an empty string for basenames without a dot. As a result, files such as Dockerfile, dockerfile, Makefile, and makefile could not reach the configured tree-sitter scoring path, even though programming_languages.json defines dockerfile and makefile.

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

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

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 -q

  • uv run pytest tests/ -q

  • uv run ruff check

  • uv run ruff format --check

  • uv run pyright

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 4, 2026

@anderdc anderdc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mkdev5

mkdev5 commented May 10, 2026

Copy link
Copy Markdown
Contributor Author

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.

done

@anderdc
anderdc merged commit 0753f0c into entrius:test May 10, 2026
3 checks passed
@mkdev5 mkdev5 mentioned this pull request Jun 25, 2026
10 tasks
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] Extensionless configured files like Dockerfile and Makefile are skipped as unsupported

3 participants