-
-
Notifications
You must be signed in to change notification settings - Fork 297
refactor(bump): cleanup related to update_version_file #1594
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?
Conversation
9e1cee1
to
b1ec6b2
Compare
@@ -75,36 +75,46 @@ def update_version_in_files( | |||
|
|||
Returns the list of updated files. | |||
""" | |||
# TODO: separate check step and write step |
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 believe this TODO is already addressed
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.
@Lee-W you left this TODO according to the git history, could you help to confirm this? Thanks.
b1ec6b2
to
4760b73
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1594 +/- ##
==========================================
+ Coverage 97.33% 98.24% +0.91%
==========================================
Files 42 58 +16
Lines 2104 2685 +581
==========================================
+ Hits 2048 2638 +590
+ 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:
|
4760b73
to
f27f093
Compare
82fc109
to
10d5b2f
Compare
commitizen/bump.py
Outdated
) | ||
|
||
# Write the file out again | ||
with smart_open(path, "w", encoding=encoding) as file: | ||
file.write(version_file) | ||
file.write(bumped_version_file_content) | ||
updated.append(path) | ||
return updated |
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.
btw the return value is not covered in the unit tests for this function. I'm not sure if it's covered anywhere else.
10d5b2f
to
ee86b9c
Compare
return sorted(out) | ||
|
||
|
||
def _bump_with_regex( |
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 believe we don't need this extra layer of abstraction.
7e0a521
to
6ede88e
Compare
check_consistency: bool = False, | ||
encoding: str = ENCODING, | ||
check_consistency: bool, | ||
encoding: str, |
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 believe we don't need this default argument. These only introduce unnecessary complexity.
6ede88e
to
a5aa553
Compare
Description
Try to address confusing variable names and function names, also reduced the number of function parameters for better readability.
Relate #1580
Better test coverage for
update_version_in_file
:check_consistency=True
encoding
valuesChecklist
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