| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| 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.
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.
Sorry, something went wrong.
There was a problem hiding this comment.
If we want to make this assumption, we'll need to make this a static method instead, which makes sense but could be seen as a breaking change.
Sorry, something went wrong.
There was a problem hiding this comment.
but making that a static method is a good idea
Sorry, something went wrong.
| out_metadata.latest_version_position = index | ||
| 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.
This index is unbounded if the file is empty, although this never happens for all code paths
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ 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.
|
Sorry, something went wrong.
… readability and better type
| 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.
If we want to make this assumption, we'll need to make this a static method instead, which makes sense but could be seen as a breaking change.
Sorry, something went wrong.
| unreleased: int | None = None | ||
| if "unreleased" in line: | ||
| unreleased = self.parse_title_level(line) | ||
| lines = [line.strip().lower() for line in file.readlines()] |
There was a problem hiding this comment.
loop through it twice, probably not worth it?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
… readability and better type
Description
Checklist
Code Changes
Documentation Changes
Expected Behavior
Steps to Test This Pull Request
Additional Context