Skip to content

feat(parser-emoji): ability to define other emoji #963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/commit-parsing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ The default configuration options for
":robot:",
":green_apple:",
]
non_triggering_tags = [
":memo:",
":construction_worker:",
":recycle:",
]

.. _commit-parser-scipy:

Expand Down
3 changes: 3 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,9 @@ the expections from ``commit_parser`` value to default options value.
":apple:", ":penguin:", ":checkered_flag:", ":robot:",
":green_apple:"
]
non_triggering_tags = [
":memo:", ":construction_worker:", ":recycle:"
]

``"scipy"`` -> .. code-block:: toml

Expand Down
7 changes: 6 additions & 1 deletion semantic_release/commit_parser/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class EmojiParserOptions(ParserOptions):
":robot:",
":green_apple:",
)
non_triggering_tags: Tuple[str, ...] = (
":memo:",
":construction_worker:",
":recycle:",
)
default_bump_level: LevelBump = LevelBump.NO_RELEASE


Expand All @@ -66,7 +71,7 @@ def get_default_options() -> EmojiParserOptions:

def parse(self, commit: Commit) -> ParseResult:
all_emojis = (
self.options.major_tags + self.options.minor_tags + self.options.patch_tags
self.options.major_tags + self.options.minor_tags + self.options.patch_tags + self.options.non_triggering_tags
)

message = str(commit.message)
Expand Down
2 changes: 1 addition & 1 deletion tests/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
]
EMOJI_COMMITS_MINOR = [
":sparkles: something special\n",
":sparkles::pencil: docs for something special\n",
":sparkles::memo: docs for something special\n",
":bug: needed a tweak\n",
"tweaked again\n",
"tweaked again\n",
Expand Down
18 changes: 13 additions & 5 deletions tests/unit/semantic_release/commit_parser/test_emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,28 @@
[":bug: Fixing a bug", "The bug is finally gone!"],
[],
),
# No release
# No release with specified emoji
(
":pencil: Documentation changes",
":memo: Documentation changes",
LevelBump.NO_RELEASE,
":memo:",
[":memo: Documentation changes"],
[],
),
# No release with random emoji
(
":construction: Work in progress",
LevelBump.NO_RELEASE,
"Other",
[":pencil: Documentation changes"],
[":construction: Work in progress"],
[],
),
# Multiple emojis
(
":sparkles::pencil: Add a feature and document it",
":sparkles::memo: Add a feature and document it",
LevelBump.MINOR,
":sparkles:",
[":sparkles::pencil: Add a feature and document it"],
[":sparkles::memo: Add a feature and document it"],
[],
),
# Emoji in description
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy