-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: parse clang-tidy output when WarningsAsErrors
is asserted
#190
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
Conversation
WalkthroughRefactored clang-tidy note header matching to use a named regex constant and updated associated tests. Adjusted demo .clang-tidy to treat all warnings as errors. Modified CI workflow to run specific clang install and coverage steps on all runners by removing Linux-only conditions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
==========================================
- Coverage 96.90% 96.87% -0.03%
==========================================
Files 14 14
Lines 3132 3134 +2
==========================================
+ Hits 3035 3036 +1
- Misses 97 98 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0bd262f
to
6eee85a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cpp-linter/src/clang_tools/clang_tidy.rs (1)
400-420
: Add assertion to verify diagnostic name excludes suffix.The test verifies that the full match includes the suffix, but it doesn't explicitly assert that capture group 6 (the diagnostic name) excludes the suffix. Consider adding an assertion to make this behavior explicit.
Apply this diff to add an explicit assertion:
assert_eq!( cap.get(0).unwrap().as_str(), format!( "{}:{}:{}: {}:{}[{},-warnings-as-errors]", cap.get(1).unwrap().as_str(), cap.get(2).unwrap().as_str(), cap.get(3).unwrap().as_str(), cap.get(4).unwrap().as_str(), cap.get(5).unwrap().as_str(), cap.get(6).unwrap().as_str() ) .as_str() - ) + ); + // Verify that capture group 6 contains only the diagnostic name, not the suffix + assert_eq!( + cap.get(6).unwrap().as_str(), + "modernize-use-trailing-return-type" + );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/run-dev-tests.yml
(0 hunks)cpp-linter/src/clang_tools/clang_tidy.rs
(4 hunks)cpp-linter/tests/demo/.clang-tidy
(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/run-dev-tests.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: lint-js
- GitHub Check: aarch64-apple-darwin
- GitHub Check: Build aarch64-unknown-linux-gnu
- GitHub Check: powerpc64le-unknown-linux-gnu
- GitHub Check: x86_64-apple-darwin
- GitHub Check: powerpc64-unknown-linux-gnu
- GitHub Check: x86_64-unknown-linux-musl
- GitHub Check: Build aarch64-pc-windows-msvc
- GitHub Check: powerpc-unknown-linux-gnu
- GitHub Check: Build i686-pc-windows-msvc
- GitHub Check: Build aarch64-apple-darwin
- GitHub Check: arm-unknown-linux-gnueabi
- GitHub Check: arm-unknown-linux-gnueabihf
- GitHub Check: Build x86_64-apple-darwin
- GitHub Check: Build x86_64-pc-windows-msvc
- GitHub Check: aarch64-unknown-linux-gnu
- GitHub Check: aarch64-unknown-linux-musl
- GitHub Check: Build FreeBSD
- GitHub Check: test (windows-latest)
- GitHub Check: test (ubuntu-latest)
🔇 Additional comments (3)
cpp-linter/tests/demo/.clang-tidy (1)
3-3
: LGTM!The change to enable all warnings as errors (
WarningsAsErrors: '*'
) is appropriate for testing the clang-tidy output parser's ability to handle the,-warnings-as-errors
suffix in diagnostic headers.cpp-linter/src/clang_tools/clang_tidy.rs (2)
144-144
: LGTM!Refactoring to use the
NOTE_HEADER
constant improves maintainability and makes the regex pattern easier to test and modify.
133-134
: Regex handles both old and new formats as expected.
corresponds to cpp-linter/cpp-linter#162
Summary by CodeRabbit