-
-
Notifications
You must be signed in to change notification settings - Fork 297
refactor(ChangelogFormat): refactor get_metadata_from_file for better… #1596
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
base: master
Are you sure you want to change the base?
refactor(ChangelogFormat): refactor get_metadata_from_file for better… #1596
Conversation
unreleased = self.parse_title_level(line) | ||
lines = file.readlines() | ||
for index, line in enumerate(line.strip().lower() for line in lines): | ||
parsed_unreleased_level = self.parse_title_level(line) |
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.
I think we can assume that self.parse_title_level
is always a pure function? Then we don't have to call it twice here.
break # there's no need for more info | ||
if meta.unreleased_start is not None and meta.unreleased_end is None: | ||
meta.unreleased_end = index |
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.
This index
is unbounded if the file is empty, although this never happens for all code paths
2bdf3cf
to
54e4288
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1596 +/- ##
==========================================
+ Coverage 97.33% 98.25% +0.91%
==========================================
Files 42 58 +16
Lines 2104 2692 +588
==========================================
+ Hits 2048 2645 +597
+ Misses 56 47 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… readability and better type
54e4288
to
edf22a8
Compare
… readability and better type
Description
Checklist
Code Changes
poetry all
locally to ensure this change passes linter check and testsDocumentation Changes
poetry doc
locally to ensure the documentation pages renders correctlyExpected Behavior
Steps to Test This Pull Request
Additional Context