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

Class ChangelogFormat

commitizen/changelog_formats/__init__.py:19–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18
19class ChangelogFormat(Protocol):
20 extension: ClassVar[str]
21 """Standard known extension associated with this format"""
22
23 alternative_extensions: ClassVar[set[str]]
24 """Known alternatives extensions for this format"""
25
26 config: BaseConfig
27
28 def __init__(self, config: BaseConfig) -> None:
29 self.config = config
30
31 @property
32 def ext(self) -> str:
33 """Dotted version of extensions, as in `pathlib` and `os` modules"""
34 return f".{self.extension}"
35
36 @property
37 def template(self) -> str:
38 """Expected template name for this format"""
39 return f"CHANGELOG.{self.extension}.{TEMPLATE_EXTENSION}"
40
41 @property
42 def default_changelog_file(self) -> str:
43 return f"CHANGELOG.{self.extension}"
44
45 def get_metadata(self, filepath: str) -> Metadata:
46 """
47 Extract the changelog metadata.
48 """
49 raise NotImplementedError
50
51 def get_latest_full_release(self, filepath: str) -> IncrementalMergeInfo:
52 """
53 Extract metadata for the last non-pre-release.
54 """
55 raise NotImplementedError
56
57
58KNOWN_CHANGELOG_FORMATS: dict[str, type[ChangelogFormat]] = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected