Skip to content
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

Add --output to redirect output to a file #667

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Freed-Wu
Copy link
Contributor

insights input.cc --output output.cc

will create output.cc and redirect the convert result to it.

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 70.37037% with 8 lines in your changes missing coverage. Please review.

Project coverage is 97.72%. Comparing base (751c3d9) to head (59217d1).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
Insights.cpp 70.37% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #667      +/-   ##
==========================================
- Coverage   98.00%   97.72%   -0.29%     
==========================================
  Files          20       20              
  Lines        6527     6552      +25     
==========================================
+ Hits         6397     6403       +6     
- Misses        130      149      +19     
Flag Coverage Δ
insights-macos 96.99% <69.56%> (-0.32%) ⬇️
insights-ubuntu-amd64-libcxx-No 97.94% <69.23%> (-0.34%) ⬇️
insights-ubuntu-amd64-libcxx-Yes 97.92% <69.23%> (-0.34%) ⬇️
insights-ubuntu-arm64-libcxx-No 97.90% <69.23%> (-0.34%) ⬇️
insights-ubuntu-arm64-libcxx-Yes 97.88% <69.23%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@andreasfertig
Copy link
Owner

Hello @Freed-Wu,

thanks for the work!

Could you please add a test for that to https://github.com/andreasfertig/cppinsights/blob/main/tests/testSTDIN.sh? A test should also increase the code coverage again. Thanks!

Andreas

@Freed-Wu
Copy link
Contributor Author

In fact, this PR comes from https://github.com/Freed-Wu/cppinsights.nvim/blob/main/Insights_.cpp#L496 I hope it can provide an API for other project used: accpet input and return the result of converting.

@andreasfertig
Copy link
Owner

Hello @Freed-Wu,

In fact, this PR comes from https://github.com/Freed-Wu/cppinsights.nvim/blob/main/Insights_.cpp#L496 I hope it can provide an API for other project used: accpet input and return the result of converting.

I like the idea.

I don't know whether I was imprecise. I'm happy to merge the PR once you add some tests for the new command line option. You can find the existing tests here: https://github.com/andreasfertig/cppinsights/blob/main/tests/testSTDIN.sh
Thanks!

Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants