context
Context definitions used in templates.
CLASS | DESCRIPTION |
---|---|
ChangelogContext |
The primary context used when rendering a changelog. |
CommitContext |
Commit information for the template context. |
GroupingContext |
A combination of a tuple of the sorted values and a list of the CommitContexts in that group. |
VersionContext |
Version information for the template context. |
Classes¶
ChangelogContext
dataclass
¶
ChangelogContext(
config: Configuration, versions: List[VersionContext] = list()
)
The primary context used when rendering a changelog.
METHOD | DESCRIPTION |
---|---|
as_dict |
Safely generate a dict version of this object. |
ATTRIBUTE | DESCRIPTION |
---|---|
config |
The changelog generation configuration.
TYPE:
|
group_by |
The configured grouping aspects for commits within a version. |
group_depth |
The number of levels version commits are grouped by.
TYPE:
|
unreleased_label |
The configured label used as the version title of the changes since the last valid tag.
TYPE:
|
valid_author_tokens |
The configured tokens in git commit trailers that indicate authorship. |
versions |
The version contexts to render in the changelog.
TYPE:
|
Attributes¶
group_by
class-attribute
instance-attribute
¶
The configured grouping aspects for commits within a version.
group_depth
class-attribute
instance-attribute
¶
The number of levels version commits are grouped by.
unreleased_label
class-attribute
instance-attribute
¶
The configured label used as the version title of the changes since the last valid tag.
valid_author_tokens
class-attribute
instance-attribute
¶
The configured tokens in git commit trailers that indicate authorship.
versions
class-attribute
instance-attribute
¶
versions: List[VersionContext] = field(default_factory=list)
The version contexts to render in the changelog.
Functions¶
CommitContext
dataclass
¶
CommitContext(
sha: str,
commit_datetime: datetime,
summary: str,
body: str,
committer: str,
grouping: tuple = tuple(),
metadata: dict = dict(),
files: set = set(),
)
Commit information for the template context.
METHOD | DESCRIPTION |
---|---|
__post_init__ |
Set the cached author information to None. |
ATTRIBUTE | DESCRIPTION |
---|---|
author_names |
A list of the authors’ names.
TYPE:
|
authors |
A list of authors’ names and emails.
TYPE:
|
body |
The commit message sans the first line.
TYPE:
|
commit_datetime |
The date and time of the commit with timezone offset.
TYPE:
|
committer |
The name and email of the committer as
TYPE:
|
files |
The file paths (relative to the repository root) modified by this commit.
TYPE:
|
grouping |
The values to group this commit based on the
TYPE:
|
metadata |
Metadata for this commit parsed from the commit message.
TYPE:
|
sha |
The full hex SHA of the commit.
TYPE:
|
short_sha |
The first seven characters of the hex sha.
TYPE:
|
summary |
The first line of the commit message.
TYPE:
|
Attributes¶
authors
property
¶
authors: list
A list of authors’ names and emails.
RETURNS | DESCRIPTION |
---|---|
list
|
A list of dictionaries with name and email keys. |
commit_datetime
instance-attribute
¶
commit_datetime: datetime
The date and time of the commit with timezone offset.
committer
instance-attribute
¶
committer: str
The name and email of the committer as name <email@ex.com>
.
files
class-attribute
instance-attribute
¶
The file paths (relative to the repository root) modified by this commit.
grouping
class-attribute
instance-attribute
¶
The values to group this commit based on the group_by
configuration.
metadata
class-attribute
instance-attribute
¶
Metadata for this commit parsed from the commit message.
Functions¶
GroupingContext
dataclass
¶
GroupingContext(grouping: Tuple[str, ...], commits: List[CommitContext])
A combination of a tuple of the sorted values and a list of the CommitContexts in that group.
VersionContext
dataclass
¶
VersionContext(
label: str,
date_time: Optional[datetime] = None,
tag: Optional[str] = None,
previous_tag: Optional[str] = None,
tagger: Optional[str] = None,
grouped_commits: List[GroupingContext] = list(),
metadata: dict = dict(),
)
Version information for the template context.
ATTRIBUTE | DESCRIPTION |
---|---|
date_time |
The date and time with timezone offset the version was tagged. |
grouped_commits |
The sections that group the commits in this version.
TYPE:
|
label |
The version label.
TYPE:
|
metadata |
Metadata for this version parsed from commits.
TYPE:
|
previous_tag |
The previous tag. |
tag |
The tag. |
tagger |
The name and email of the person who tagged this version in |
Attributes¶
date_time
class-attribute
instance-attribute
¶
The date and time with timezone offset the version was tagged.
grouped_commits
class-attribute
instance-attribute
¶
grouped_commits: List[GroupingContext] = field(default_factory=list)
The sections that group the commits in this version.
metadata
class-attribute
instance-attribute
¶
Metadata for this version parsed from commits.
previous_tag
class-attribute
instance-attribute
¶
The previous tag.