-
-
Notifications
You must be signed in to change notification settings - Fork 8
Switch to unidiff #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to unidiff #115
Conversation
It seems that our pr-review test wasn't generating suggestions with clang tools v7 and v8. I'm inclined to skip those versions when running tests, but It might be better to adjust the checks so that those versions generate suggestions. Also, there seems to be a problem in CI where the coverage data ( |
1289df3
to
3c92309
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 24 +2
Lines 1665 1737 +72
=========================================
+ Hits 1665 1737 +72 ☔ View full report in Codecov by Sentry. |
3c92309
to
1c6d246
Compare
db2e591
to
55302c0
Compare
👀 uh ohThe generated diff from I'm going to have to rethink and revert somethings here. |
Ok, |
I'm refactoring the branch and will open a new PR shortly. |
This migrates diff-parsing fallback mechanism (previously using regex patterns) to new dependecy unidiff.
This allows for a few new tactics:
able to parse partial patches provided by REST API endpoints that list files with individual patch for each file (addresses Unable to fetch diff for a large PR cpp-linter-action#249)
able to move PR review comment generation from
rest_api/github_api.py
module into newclang_tools.patcher.py
module because we don't need to keep data (previously used bypygit2.Patch
) alive for the entire process (which avoided data corruption when the string of changes dropped out of scope).This change employs a mixin class to generate PR suggestions (for better/clearer code reuse).
I originally intended to use this to merge suggestions from both tools, but that isn't as easy as it sounds. Perhaps later, I can experiment with diff merging using these changes.