-
Notifications
You must be signed in to change notification settings - Fork 0
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 header/footer #8
Conversation
Reviewer's Guide by SourceryThis pull request adds the ability to specify a header and footer when saving a FileStream to a plain text file. It also modifies the default delimiter for plain text files to be a newline character. Finally, it includes a test case to verify the new functionality. Sequence diagram for FileStream plain text saving with header/footersequenceDiagram
participant Client
participant FileStream
participant File
Client->>FileStream: save(f_write_options={header, footer})
activate FileStream
FileStream->>FileStream: _write_plain()
FileStream->>FileStream: to_string(delimiter)
FileStream->>FileStream: Combine header + content + footer
FileStream->>File: writelines(output)
File-->>FileStream: Success
FileStream-->>Client: Success
deactivate FileStream
Class diagram showing FileStream changesclassDiagram
class FileStream {
+save(f_open_options: dict, f_write_options: dict)
-_write_plain(path: str, tmp_path: str, f_open_options: dict, f_write_options: dict)
+to_string(delimiter: str) str
}
note for FileStream "Modified _write_plain to support header/footer"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Hey @kaliv0 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Add support for specifying header and footer when saving plain text files.
New Features:
header
andfooter
options to thef_write_options
parameter of thesave()
method to support prepending and appending text to plain text files.Tests:
header
andfooter
options.