Skip to content

refactor(bump): code cleanup and better test coverage #1422

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

Open
wants to merge 5 commits into
base: refactors
Choose a base branch
from

Conversation

bearomorphism
Copy link
Contributor

@bearomorphism bearomorphism commented May 16, 2025

Description

Checklist

Code Changes

  • Add test cases to all the changes you introduce
  • Run poetry all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run poetry doc locally to ensure the documentation pages renders correctly

Expected Behavior

Steps to Test This Pull Request

Additional Context

Copy link

codecov bot commented May 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (refactors@a0cc490). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff              @@
##             refactors    #1422   +/-   ##
============================================
  Coverage             ?   97.68%           
============================================
  Files                ?       57           
  Lines                ?     2680           
  Branches             ?        0           
============================================
  Hits                 ?     2618           
  Misses               ?       62           
  Partials             ?        0           
Flag Coverage Δ
unittests 97.68% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bearomorphism bearomorphism changed the title refactor: bump refactor(bump): code cleanup and better test coverage May 17, 2025
@@ -148,7 +144,7 @@ def __call__(self) -> None: # noqa: C901
except TypeError:
raise NoVersionSpecifiedError()

bump_commit_message: str = self.bump_settings["bump_message"]
bump_commit_message: str | None = self.bump_settings["bump_message"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This type should be str | None because the default value is None. Not sure if we can improve the type safety here.

Copy link
Member

Choose a reason for hiding this comment

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

I think we'll need to redesign the config as a whole #1445

but let's keep it for now

@bearomorphism
Copy link
Contributor Author

Let me reorganize the commits.

@Lee-W Lee-W changed the base branch from master to refactors May 22, 2025 03:26
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

Left a few nits but ready to merge

@@ -148,7 +144,7 @@ def __call__(self) -> None: # noqa: C901
except TypeError:
raise NoVersionSpecifiedError()

bump_commit_message: str = self.bump_settings["bump_message"]
bump_commit_message: str | None = self.bump_settings["bump_message"]
Copy link
Member

Choose a reason for hiding this comment

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

I think we'll need to redesign the config as a whole #1445

but let's keep it for now

Comment on lines +1695 to +1698
from commitizen import defaults
from commitizen.commands.bump import Bump
from commitizen.config import BaseConfig

Copy link
Member

Choose a reason for hiding this comment

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

nit: is there any specific reason we need to import it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess no. I'll fix it when I have time later this weekend

@Lee-W Lee-W added pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check and removed pr-status: wait-for-review labels May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants