semantic_release.commit_parser.conventional.parser module

class semantic_release.commit_parser.conventional.parser.ConventionalCommitParser(options: ConventionalCommitParserOptions | None = None)[source]

Bases: CommitParser[ParsedCommit | ParseError, ConventionalCommitParserOptions]

A commit parser for projects conforming to the conventional commits specification.

See https://www.conventionalcommits.org/en/v1.0.0/

commit_body_components_separator(accumulator: dict[str, list[str]], text: str) dict[str, list[str]][source]
common_commit_msg_filters: ClassVar[dict[str, tuple[Pattern[str], str]]] = {'git-header-author': (re.compile('^[\\t ]*Author: .+$\\n?', re.MULTILINE), ''), 'git-header-commit': (re.compile('^[\\t ]*commit [0-9a-f]+$\\n?', re.MULTILINE), ''), 'git-header-date': (re.compile('^[\\t ]*Date: .+$\\n?', re.MULTILINE), ''), 'git-squash-heading': (re.compile('^[\\t ]*Squashed commit of the following:.*$\\n?', re.MULTILINE), ''), 'typo-extra-spaces': (re.compile('(\\S)  +(\\S)'), '\\1 \\2')}
create_parsed_message_result(match: Match[str]) ParsedMessageResult[source]
get_default_options() ConventionalCommitParserOptions[source]
static is_merge_commit(commit: Commit) bool[source]
issue_selector = re.compile('^(?:clos(?:e|es|ed|ing)|fix(?:es|ed|ing)?|resolv(?:e|es|ed|ing)|implement(?:s|ed|ing)?):[\\t ]+(?P<issue_predicate>.+)[\\t ]*$', re.IGNORECASE|re.MULTILINE)
log_parse_error(commit: Commit, error: str) ParseError[source]
mr_selector = re.compile('[\\t ]+\\((?:pull request )?(?P<mr_number>[#!]\\d+)\\)[\\t ]*$')
notice_selector = re.compile('^NOTICE: (?P<notice>.+)$')
parse(commit: Commit) ParsedCommit | ParseError | list[ParsedCommit | ParseError][source]

Parse a commit message

If the commit message is a squashed merge commit, it will be split into multiple commits, each of which will be parsed separately. Single commits will be returned as a list of a single ParseResult.

parse_commit(commit: Commit) ParsedCommit | ParseError[source]
parse_message(message: str) ParsedMessageResult | None[source]
parser_options

alias of ConventionalCommitParserOptions

unsquash_commit(commit: Commit) list[Commit][source]
unsquash_commit_message(message: str) list[str][source]