Open
Conversation
Collaborator
|
just merged big changes into test please fix conflicts thanks |
e39bbe8 to
d9ff4cd
Compare
d9ff4cd to
d8a9df5
Compare
Author
|
@anderdc I've rebased it on current |
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.
Closes #339
This PR addresses the issue that test code affect scoring process.
Before
After
Implementation details
ScoringCategoryenum. Possible values areTEST(if it's a test file),SOURCE(if scoring method istree_sitterand it's not a test file),NON_CODE(everything else: recognized non-code changes, unrecognized non-code changes, deleted files, binary files)PrScoringResultCategorized, which holdsPrScoringResultper each existing category.scoring.pyintoPrScoringResultCategorizedmethods.Test cases
Test files:
test_adding_tests_does_not_reduce_score- Adding test files to a source PR never lowers the base scoretest_tests_do_not_affect_contribution_bonus- Small and large test files produce modest, similar increases (test weight is 0.05x)test_same_code_in_test_path_scores_much_lower- Identical code in a test directory scores 10x+ lower than in a source pathtest_tests_do_not_affect_threshold- Test files can't push a below-threshold PR past the token score thresholdNon-code files:
test_adding_non_code_files_does_not_reduce_score- Adding non-code files (markdown, yaml) never lowers the base scoretest_non_code_does_not_affect_contribution_bonus- Small and large non-code files produce the same density increase (no bonus impact)test_source_code_scores_much_higher_than_non_code- Tree-diff scored source code scores 10x+ higher than line-count scored non-code filestest_non_code_does_not_affect_threshold- Non-code files can't push a below-threshold PR past the token score thresholdZero-score files:
test_deleted_file_does_not_change_score- Deleted files (score=0) don't affect the base scoretest_unsupported_file_does_not_change_score- Unsupported extensions (score=0) don't affect the base scoreDensity:
test_adding_test_category_increases_score_beyond_single_cap- Per-category density cap allows multiple categories to contribute independentlytest_verbose_formatting_decreases_score- Same logic in more lines produces lower density and lower scoretest_modified_file_scores_diff_only- Modified files score only the AST diff, not the entire fileThreshold:
test_below_threshold_scores_less- Trivial changes below token score threshold score less than substantial changes