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

substrate: Add basic file utility to read all the lines from a file #87

Merged

Conversation

amyspark
Copy link
Collaborator

Hey @dragonmux,

This is a PR to add a small line reader to Substrate.

As you'll find in the attached test suite, I wasn't able to make it work with UTF-16 and wchar_t strings. Hope you can assist me in that regard.

Let me know what you think 🐱

Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good - there are some stylistic items which we note below, and one query about something that seems missing, but we'll dig into this with you to understand the UTF-16 case and what's going on there

substrate/file_utils Outdated Show resolved Hide resolved
test/file_utils.cxx Outdated Show resolved Hide resolved
test/file_utils.cxx Outdated Show resolved Hide resolved
test/file_utils.cxx Outdated Show resolved Hide resolved
substrate/file_utils Outdated Show resolved Hide resolved
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a couple of stylistic things to address, but this looks pretty close to mergable - nice work! ^_^

substrate/internal/fd_compat Outdated Show resolved Hide resolved
substrate/file_utils Outdated Show resolved Hide resolved
substrate/file_utils Outdated Show resolved Hide resolved
substrate/file_utils Outdated Show resolved Hide resolved
test/file_utils.cxx Outdated Show resolved Hide resolved
test/file_utils.cxx Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (9f0886d) 89.24% compared to head (d12eac8) 89.27%.

Files Patch % Lines
substrate/file_utils 90.90% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #87      +/-   ##
==========================================
+ Coverage   89.24%   89.27%   +0.03%     
==========================================
  Files          47       48       +1     
  Lines        3516     3554      +38     
  Branches      688      703      +15     
==========================================
+ Hits         3138     3173      +35     
  Misses        341      341              
- Partials       37       40       +3     

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

Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we'll merge this once the builds complete. Thank you for the contribution!

@dragonmux dragonmux merged commit d12eac8 into bad-alloc-heavy-industries:main Jan 18, 2024
86 checks passed
@amyspark amyspark deleted the amyspark/readlines branch January 19, 2024 00:21
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.

2 participants