Skip to content

feat(bump_rule): add BumpRule, VersionIncrement, Prerelease Enum#1518

Draft
bearomorphism wants to merge 1 commit intocommitizen-tools:masterfrom
bearomorphism:bump-rule-interface
Draft

feat(bump_rule): add BumpRule, VersionIncrement, Prerelease Enum#1518
bearomorphism wants to merge 1 commit intocommitizen-tools:masterfrom
bearomorphism:bump-rule-interface

Conversation

@bearomorphism
Copy link
Collaborator

Related issue: #129
Original PR: #1431

Description

Please see bump_rule.py, bump.py, cz/base.py, version_scheme.py and commands/bump.py (~350 lines).
The rest 1000+ lines are just tests and renaming.

  • Rewrote the bump pattern matching mechanism to make the algorithm more strict and maintainable.
  • Maintained backward compatibility with CustomBumpRule.
  • Simplified code.
  • Added a new Enum class SemVerIncrement and replace MAJOR, MINOR, PATCH with the Enum.
  • Now Prerelease is Enum.
  • Simplify find_increment logic in SemVerIncrement.get_highest_by_messages.
    • find_increment was the combination of 2 features: "finding the highest semantic version increment" and "parsing the semantic version increment from each git commit message".

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants