Skip to content

metadata

Metadata callback and processing functions.

CLASS DESCRIPTION
MetadataCollector

Creates a callable to collect key-value metadata.

ParseAzureBoardIssue

Parse Azure board issues from commits.

ParseBreakingChangeFooter

Parse a breaking change footer.

ParseConventionalCommit

Parse a line of text using the conventional commit syntax.

ParseGitHubIssue

Parse GitHub issue references from commits.

ParseIssue

Base class to parse an issue reference and put it into the commit metadata.

ParseJiraIssue

Parse Jira issues from commits.

ParseTrailers

Parse and extract trailers from a commit message.

Classes

MetadataCollector dataclass

MetadataCollector(metadata: dict = dict())

Creates a callable to collect key-value metadata.

METHOD DESCRIPTION
__call__

Put keyword arguments into metadata storage.

Functions

__call__
__call__(**kwargs: dict)

Put keyword arguments into metadata storage.

PARAMETER DESCRIPTION
**kwargs

keyword arguments to update metadata

TYPE: dict DEFAULT: {}

ParseAzureBoardIssue

ParseAzureBoardIssue(
    commit_metadata: Callable, issue_pattern: Optional[str] = None
)

Bases: ParseIssue

Parse Azure board issues from commits.

Link these Azure board issues to their source using a URL pattern like:

https://dev.azure.com/<organization>/<project>/_workitems/edit/<issue number>

References
  • https://docs.microsoft.com/en-us/azure/devops/boards/github/link-to-from-github

ParseBreakingChangeFooter

ParseBreakingChangeFooter(commit_metadata: Callable)

Parse a breaking change footer.

METHOD DESCRIPTION
__call__

Parse a BREAKING CHANGE footer.

Functions

__call__
__call__(message: str) -> str

Parse a BREAKING CHANGE footer.

PARAMETER DESCRIPTION
message

The commit message

TYPE: str

RETURNS DESCRIPTION
str

The commit message for later processing.

ParseConventionalCommit

ParseConventionalCommit(commit_metadata: Callable)

Parse a line of text using the conventional commit syntax.

The metadata will contain commit_type, a string and scopes, an empty list or a list of strings.

If a breaking change is indicated (with the !), metadata will also contain has_breaking_change set to True.

The description is returned for further processing.

If the summary does not match a conventional commit, the whole line is returned.

METHOD DESCRIPTION
__call__

Parse a line of text using the conventional commit syntax.

Functions

__call__
__call__(message: str) -> str

Parse a line of text using the conventional commit syntax.

PARAMETER DESCRIPTION
message

The commit message

TYPE: str

RETURNS DESCRIPTION
str

The description for later processing.

ParseGitHubIssue

ParseGitHubIssue(
    commit_metadata: Callable, issue_pattern: Optional[str] = None
)

Bases: ParseIssue

Parse GitHub issue references from commits.

Link these GitHub issues to their source using a URL pattern like:

https://github.com/<owner>/<repository>/issues/<issue number>

References
  • https://docs.github.com/en/ get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls

ParseIssue

ParseIssue(commit_metadata: Callable, issue_pattern: Optional[str] = None)

Base class to parse an issue reference and put it into the commit metadata.

METHOD DESCRIPTION
__call__

Put the issue(s) reference into the commit metadata using the keyword issue .

Functions

__call__
__call__(message: str) -> str

Put the issue(s) reference into the commit metadata using the keyword issue .

PARAMETER DESCRIPTION
message

The commit message

TYPE: str

RETURNS DESCRIPTION
str

The commit message for later processing.

ParseJiraIssue

ParseJiraIssue(commit_metadata: Callable, issue_pattern: Optional[str] = None)

Bases: ParseIssue

Parse Jira issues from commits.

References
  • https://support.atlassian.com/jira-software-cloud/docs/process-issues-with-smart-commits/

ParseTrailers

ParseTrailers(commit_metadata: Callable)

Parse and extract trailers from a commit message.

METHOD DESCRIPTION
__call__

Parse and extract trailers from a commit message.

Functions

__call__
__call__(message: str) -> str

Parse and extract trailers from a commit message.

Functions