commits
Filter and process commits into contexts.
FUNCTION | DESCRIPTION |
---|---|
create_version_context |
Generate a |
first_matching |
Return the first section that matches the given commit summary. |
generate_commit_context |
Create the renderable context for this commit. |
get_context_from_tags |
Generate the template context from git tags. |
sort_group_commits |
Sort the commit groups and convert the |
Classes¶
Functions¶
create_version_context
¶
create_version_context(config: Configuration, tag: GitTag) -> VersionContext
Generate a VersionContext
from a tag dictionary.
PARAMETER | DESCRIPTION |
---|---|
config
|
The current configuration object.
TYPE:
|
tag
|
A GitTag used as the basis for a VersionContext
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
VersionContext
|
The finished version context. |
first_matching
¶
first_matching(actions: list, commit: CommitContext) -> Optional[str]
Return the first section that matches the given commit summary.
PARAMETER | DESCRIPTION |
---|---|
actions
|
A mapping of section names to a list of regular expressions for matching.
TYPE:
|
commit
|
The commit context to evaluate
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Optional[str]
|
The name of the section. |
generate_commit_context
¶
generate_commit_context(
commit: Commit,
config: Configuration,
version_metadata_func: Optional[Callable],
) -> CommitContext
Create the renderable context for this commit.
The summary and body are processed through their pipelines, and a category is assigned.
PARAMETER | DESCRIPTION |
---|---|
commit
|
The original commit data
TYPE:
|
config
|
The configuration to use
TYPE:
|
version_metadata_func
|
An optional callable to set version metadata while processing |
RETURNS | DESCRIPTION |
---|---|
CommitContext
|
The render-able commit context |
get_context_from_tags
¶
get_context_from_tags(
repository: Repo, config: Configuration, starting_tag: Optional[str] = None
) -> List[VersionContext]
Generate the template context from git tags.
PARAMETER | DESCRIPTION |
---|---|
repository
|
The git repository to evaluate.
TYPE:
|
config
|
The current configuration object.
TYPE:
|
starting_tag
|
Optional starting tag for generating incremental changelogs. |
RETURNS | DESCRIPTION |
---|---|
List[VersionContext]
|
A list of VersionContext objects. |
sort_group_commits
¶
sort_group_commits(commit_groups: dict) -> list[GroupingContext]
Sort the commit groups and convert the dict
into a list of GroupingContext
objects.
PARAMETER | DESCRIPTION |
---|---|
commit_groups
|
A dict where the keys are grouping values.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[GroupingContext]
|
A list of |