Skip to content
Back to top
View this page

# semantic_release.commit_parser.emoji module

Commit parser which looks for emojis to determine the type of commit

class semantic_release.commit_parser.emoji.EmojiCommitParser(options: EmojiParserOptions | None = None)

  Bases: `CommitParser`[`ParsedCommit` | `ParseError`, `EmojiParserOptions`]

  Parse a commit using an emoji in the subject line. When multiple emojis are encountered, the one with the highest bump level is used. If there are multiple emojis on the same level, the we use the one listed earliest in the configuration. If the message does not contain any known emojis, then the level to bump will be 0 and the type of change “Other”. This parser never raises UnknownCommitMessageStyleError. Emojis are not removed from the description, and will appear alongside the commit subject in the changelog.

  commit_body_components_separator(accumulator: dict[str, list[str]], text: str) → dict[str, list[str]]
  static get_default_options() → EmojiParserOptions
  static is_merge_commit(commit: Commit) → bool
  parse(commit: Commit) → ParsedCommit | ParseError | list[ParsedCommit | ParseError]

    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
  parse_message(message: str) → ParsedMessageResult
  parser_options

    alias of `EmojiParserOptions`

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

class semantic_release.commit_parser.emoji.EmojiParserOptions(major_tags: Tuple[str, ...] = (':boom:',), minor_tags: Tuple[str, ...] = (':sparkles:', ':children_crossing:', ':lipstick:', ':iphone:', ':egg:', ':chart_with_upwards_trend:'), patch_tags: Tuple[str, ...] = (':ambulance:', ':lock:', ':bug:', ':zap:', ':goal_net:', ':alien:', ':wheelchair:', ':speech_balloon:', ':mag:', ':apple:', ':penguin:', ':checkered_flag:', ':robot:', ':green_apple:'), other_allowed_tags: Tuple[str, ...] = (':memo:', ':checkmark:'), allowed_tags: Tuple[str, ...] = (':boom:', ':sparkles:', ':children_crossing:', ':lipstick:', ':iphone:', ':egg:', ':chart_with_upwards_trend:', ':ambulance:', ':lock:', ':bug:', ':zap:', ':goal_net:', ':alien:', ':wheelchair:', ':speech_balloon:', ':mag:', ':apple:', ':penguin:', ':checkered_flag:', ':robot:', ':green_apple:', ':memo:', ':checkmark:'), default_bump_level: LevelBump = LevelBump.NO_RELEASE, parse_linked_issues: bool = False, parse_squash_commits: bool = True, ignore_merge_commits: bool = True)

  Bases: `ParserOptions`

  Options dataclass for EmojiCommitParser

  allowed_tags: Tuple[str, ...] = (':boom:', ':sparkles:', ':children_crossing:', ':lipstick:', ':iphone:', ':egg:', ':chart_with_upwards_trend:', ':ambulance:', ':lock:', ':bug:', ':zap:', ':goal_net:', ':alien:', ':wheelchair:', ':speech_balloon:', ':mag:', ':apple:', ':penguin:', ':checkered_flag:', ':robot:', ':green_apple:', ':memo:', ':checkmark:')

    All commit-type prefixes that are allowed.

  default_bump_level: LevelBump = 0

    The minimum bump level to apply to valid commit message.

  ignore_merge_commits: bool = True

    Toggle flag for whether or not to ignore merge commits

  major_tags: Tuple[str, ...] = (':boom:',)

    Commit-type prefixes that should result in a major release bump.

  minor_tags: Tuple[str, ...] = (':sparkles:', ':children_crossing:', ':lipstick:', ':iphone:', ':egg:', ':chart_with_upwards_trend:')

    Commit-type prefixes that should result in a minor release bump.

  other_allowed_tags: Tuple[str, ...] = (':memo:', ':checkmark:')

    Commit-type prefixes that are allowed but do not result in a version bump.

  parse_linked_issues: bool = False

    Whether to parse linked issues from the commit message.

    Issue identification is not defined in the Gitmoji specification, so this parser will not attempt to parse issues by default. If enabled, the parser will use the same identification as GitHub, GitLab, and BitBucket use for linking issues, which is to look for a git commit message footer starting with “Closes:”, “Fixes:”, or “Resolves:” then a space, and then the issue identifier. The line prefix can be singular or plural and it is not case-sensitive but must have a colon and a whitespace separator.

  parse_squash_commits: bool = True

    Toggle flag for whether or not to parse squash commits

  patch_tags: Tuple[str, ...] = (':ambulance:', ':lock:', ':bug:', ':zap:', ':goal_net:', ':alien:', ':wheelchair:', ':speech_balloon:', ':mag:', ':apple:', ':penguin:', ':checkered_flag:', ':robot:', ':green_apple:')

    Commit-type prefixes that should result in a patch release bump.

  property tag_to_level: dict[str, LevelBump]

    A mapping of commit tags to the level bump they should result in.