Skip to content

fix: capture stderr in subprocess output for clang-tidy#186

Merged
shenxianpeng merged 1 commit intomainfrom
bugfix/catch-stderr
Mar 18, 2026
Merged

fix: capture stderr in subprocess output for clang-tidy#186
shenxianpeng merged 1 commit intomainfrom
bugfix/catch-stderr

Conversation

@shenxianpeng
Copy link
Member

@shenxianpeng shenxianpeng commented Mar 18, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved error capture to include all diagnostic messages from the linter, ensuring comprehensive output is displayed to users instead of missing some warnings and errors.

@github-actions github-actions bot added the bug Something isn't working label Mar 18, 2026
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.41%. Comparing base (91a795b) to head (fdbfcae).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #186   +/-   ##
=======================================
  Coverage   95.41%   95.41%           
=======================================
  Files           4        4           
  Lines         109      109           
=======================================
  Hits          104      104           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 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.

@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d718683d-81cf-4b69-820a-7b50044fe9ef

📥 Commits

Reviewing files that changed from the base of the PR and between 91a795b and fdbfcae.

📒 Files selected for processing (1)
  • cpp_linter_hooks/clang_tidy.py

Walkthrough

The run_clang_tidy function in the clang_tidy module now captures stderr from subprocess execution in addition to stdout and concatenates both streams into the output variable. Previously, only stdout was captured.

Changes

Cohort / File(s) Summary
Stderr Capture Enhancement
cpp_linter_hooks/clang_tidy.py
Modified subprocess.run call to capture stderr via stderr=subprocess.PIPE and concatenate it with stdout, ensuring warnings/errors emitted to stderr are included in output processing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

bug

Suggested reviewers

  • 2bndy5
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: capturing stderr in subprocess output for clang-tidy, which matches the file modifications in cpp_linter_hooks/clang_tidy.py.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/catch-stderr
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shenxianpeng shenxianpeng merged commit 49766b0 into main Mar 18, 2026
19 checks passed
@shenxianpeng shenxianpeng deleted the bugfix/catch-stderr branch March 18, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant