MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / from_match

Method from_match

commitizen/version_increment.py:91–102  ·  view source on GitHub ↗

Resolve one extracted bump token against a configured bump map. The first regular-expression key that matches wins, preserving the current user-visible behavior of ``bump_map`` ordering.

(
        cls, matched_text: str, increments_map: Mapping[str, object]
    )

Source from the content-addressed store, hash-verified

89
90 @classmethod
91 def from_match(
92 cls, matched_text: str, increments_map: Mapping[str, object]
93 ) -> VersionIncrement:
94 """Resolve one extracted bump token against a configured bump map.
95
96 The first regular-expression key that matches wins, preserving the
97 current user-visible behavior of ``bump_map`` ordering.
98 """
99 for match_pattern, increment in increments_map.items():
100 if re.match(match_pattern, matched_text):
101 return cls._from_bump_map_value(increment)
102 return cls.NONE
103
104 @classmethod
105 def from_message(

Callers 1

from_messageMethod · 0.80

Calls 1

_from_bump_map_valueMethod · 0.80

Tested by

no test coverage detected