Skip to content

feat: merge review suggestions from both clang tools#358

Draft
2bndy5 wants to merge 2 commits into
mainfrom
join-tools-reviews
Draft

feat: merge review suggestions from both clang tools#358
2bndy5 wants to merge 2 commits into
mainfrom
join-tools-reviews

Conversation

@2bndy5

@2bndy5 2bndy5 commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

This is a culmination of

As this builds on the plan discussed in cpp-linter/cpp-linter#82, it it the last step needed before providing a patch that consumers can push to auto-fix lints.

Intended flow of data

  1. run clang-tidy before running clang-format
  2. after running clang-tidy save the patched file to cache
  3. after running clang-format:
    • check for clang-tidy patch in cache.
    • if cached patch is present, run clang-format on the clang-tidy patch. This step includes formatting lines that clang-tidy changed and lines that clang-format changed.
    • if cached patch is not present (clang-tidy was not run on the file), then cache the clang-format fixes instead.
    • --lines-changed-only is respected, but this may need tweaking in the future.
  4. when creating a PR review,
    • only add hunks to the patch that are not present in the review comments.
    • I added a parameter to also calculate (and display) how many review comments were reused in previous PR reviews.
    • PR review summaries are worded better if the env var CPP_LINTER_PR_REVIEW_SUMMARY_ONLY = 1

Adjusted tests accordingly.

This is a culmination of
- #354
- #347

It it the last step needed before providing a patch that consumers can push to auto-fix lints.

# Intended flow of data
1. run clang-tidy before running clang-format
2. after running clang-tidy save the patched file to cache
3. after running clang-format:
    - check for clang-tidy patch in cache.
    - if cached patch is present, run clang-format on the clang-tidy patch. This step includes formatting lines that clang-tidy changed and lines that clang-format changed.
    - if cached patch is not present (clang-tidy was not run on the file), then cache the clang-format fixes instead.
    - `--lines-changed-only` is respected, but this may need tweaking in the future.
4. when creating a PR review, only add hunks that are not present in the review comments. I added a parameter to also calculate (and display) how many review comments were reused in previous PR reviews.

Adjusted tests accordingly.
@2bndy5 2bndy5 added the enhancement New feature or request label Jun 14, 2026
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.33333% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.07%. Comparing base (9c54ee6) to head (646fc1c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cpp-linter/src/clang_tools/clang_format.rs 70.49% 18 Missing ⚠️
cpp-linter/src/common_fs.rs 89.87% 8 Missing ⚠️
cpp-linter/src/clang_tools/mod.rs 89.55% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #358      +/-   ##
==========================================
- Coverage   92.84%   92.07%   -0.77%     
==========================================
  Files          23       23              
  Lines        3464     3519      +55     
==========================================
+ Hits         3216     3240      +24     
- Misses        248      279      +31     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant