You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor: reduce complexity in Bump and remove duplicate config parsing #2129
DPy (DesignitePython, a static analysis tool) reports Bump.call in commitizen/commands/bump.py as a long method (172 lines) and a complex method (cyclomatic complexity 27). JsonConfig, TomlConfig and YAMLConfig also repeat the same _parse_setting steps. This makes Bump hard to read and change one step at a time.
Possible Solution
Bump.call: rename the reused variable c, name the tag sign/annotate conditions, extract the duplicate "not eligible for bump" check and the commit retry check, and extract the changelog step into _update_changelog.
Config: pull up the shared _parse_setting steps into BaseConfig.
Move smart_open and EOLType from commitizen.git to a new commitizen.eol module. commitizen.git keeps exporting both names.
Extract the git commit/tag steps from Bump into a GitReleasePublisher class.
Activity
woile commentedon Nov 26, 2026
Hi thanks for this but it doesn't add any value