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 88.88889% with 3 lines in your changes missing coverage. Please review.

Project coverage is 97.82%. Comparing base (751c3d9) to head (2fbdc68).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
Insights.cpp 88.88% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #667      +/-   ##
==========================================
- Coverage   98.00%   97.82%   -0.19%     
==========================================
  Files          20       20              
  Lines        6527     6561      +34     
==========================================
+ Hits         6397     6418      +21     
- Misses        130      143      +13     
Flag Coverage Δ
insights-macos 97.01% <69.56%> (-0.29%) ⬇️
insights-ubuntu-amd64-libcxx-No 98.05% <88.00%> (-0.23%) ⬇️
insights-ubuntu-amd64-libcxx-Yes 98.03% <88.00%> (-0.23%) ⬇️
insights-ubuntu-arm64-libcxx-No 98.01% <88.00%> (-0.23%) ⬇️
insights-ubuntu-arm64-libcxx-Yes 97.99% <88.00%> (-0.23%) ⬇️

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