fix: share language matcher with plain diff provider - #2895
Merged
IsmaelMartinez merged 1 commit intoAug 31, 2026
Merged
IsmaelMartinez merged 1 commit into
IsmaelMartinez merged 1 commit into
Conversation
Contributor
Author
|
/agentic_review |
Contributor
IsmaelMartinez
approved these changes
Aug 31, 2026
IsmaelMartinez
left a comment
Collaborator
There was a problem hiding this comment.
Approving and merging as-is.
The revert probe confirms the test earns its place: restore main's plain_diff_provider.py and it goes red, returning {'C': 100.0} instead of {'C++': 50.0, 'Dockerfile': 50.0}.
The payoff runs deeper than the token counts. On main a diff of upper.C and Dockerfile reported C at 100 percent and then sorted both files into "Other", so the language it advertised and the buckets it built disagreed. They now come from the same matcher.
Thanks for turning this round within half an hour of the issue going up, and for adding the regression I asked for.
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
PlainDiffGitProvider's private extension inversion with the sharedbuild_language_file_matcher.CandDockerfile, as requested in the issueWhy
The private implementation lowercased extensions and relied on
os.path.splitext(). That classified.Cas C instead of C++, dropped full filenames such asDockerfile, and truncated multipart suffixes. Reusing the shared matcher keeps plain-diff behavior aligned with the other local providers.Fixes #2894
Testing
PYTHONPATH=. uv run pytest tests/unittest -q— 2,758 passed, 1 skipped, 1 xfaileduv run pre-commit run --files pr_agent/git_providers/plain_diff_provider.py tests/unittest/test_plain_diff_provider.py— passeduv run ruff check --fix pr_agent/git_providers/plain_diff_provider.py tests/unittest/test_plain_diff_provider.py— passed