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

Class AsciiDoc

commitizen/changelog_formats/asciidoc.py:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12class AsciiDoc(BaseFormat):
13 extension = "adoc"
14
15 RE_TITLE = re.compile(r"^(?P<level>=+) (?P<title>.*)$")
16
17 def parse_version_from_title(self, line: str) -> VersionTag | None:
18 m = self.RE_TITLE.match(line)
19 if not m:
20 return None
21 # Capture last match as AsciiDoc use postfixed URL labels
22 return self.tag_rules.search_version(m.group("title"), last=True)
23
24 def parse_title_level(self, line: str) -> int | None:
25 m = self.RE_TITLE.match(line)
26 if not m:
27 return None
28 return len(m.group("level"))

Callers 2

formatFunction · 0.90
format_with_tagsFunction · 0.90

Calls

no outgoing calls

Tested by 2

formatFunction · 0.72
format_with_tagsFunction · 0.72