semantic_release.commit_parser.conventional module¶
- class semantic_release.commit_parser.conventional.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]¶
- static get_default_options() ConventionalCommitParserOptions[source]¶
- 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
- class semantic_release.commit_parser.conventional.ConventionalCommitParserOptions(minor_tags: Tuple[str, ...] = ('feat',), patch_tags: Tuple[str, ...] = ('fix', 'perf'), other_allowed_tags: Tuple[str, ...] = ('build', 'chore', 'ci', 'docs', 'style', 'refactor', 'test'), allowed_tags: Tuple[str, ...] = ('feat', 'fix', 'perf', 'build', 'chore', 'ci', 'docs', 'style', 'refactor', 'test'), default_bump_level: LevelBump = LevelBump.NO_RELEASE, parse_squash_commits: bool = True, ignore_merge_commits: bool = True)[source]¶
Bases:
ParserOptionsOptions dataclass for the ConventionalCommitParser.
- allowed_tags: Tuple[str, ...] = ('feat', 'fix', 'perf', 'build', 'chore', 'ci', 'docs', 'style', 'refactor', 'test')¶
All commit-type prefixes that are allowed.
These are used to identify a valid commit message. If a commit message does not start with one of these prefixes, it will not be considered a valid commit message.
- ignore_merge_commits: bool = True¶
Toggle flag for whether or not to ignore merge commits
- minor_tags: Tuple[str, ...] = ('feat',)¶
Commit-type prefixes that should result in a minor release bump.
- other_allowed_tags: Tuple[str, ...] = ('build', 'chore', 'ci', 'docs', 'style', 'refactor', 'test')¶
Commit-type prefixes that are allowed but do not result in a version bump.
- parse_squash_commits: bool = True¶
Toggle flag for whether or not to parse squash commits
- patch_tags: Tuple[str, ...] = ('fix', 'perf')¶
Commit-type prefixes that should result in a patch release bump.