Skip to content

Commit 2833aa9

Browse files
authored
feat(parser-emoji): adds more non-release triggering emojis to the default emoji parser (python-semantic-release#1410)
* test(parser-emoji): add unit tests for no-release triggering emoji commits
1 parent 24b91f4 commit 2833aa9

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

src/semantic_release/commit_parser/emoji.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ class EmojiParserOptions(ParserOptions):
6565
)
6666
"""Commit-type prefixes that should result in a patch release bump."""
6767

68-
other_allowed_tags: Tuple[str, ...] = (":memo:", ":checkmark:")
68+
other_allowed_tags: Tuple[str, ...] = (
69+
":checkmark:",
70+
":construction_worker:",
71+
":memo:",
72+
":recycle:",
73+
)
6974
"""Commit-type prefixes that are allowed but do not result in a version bump."""
7075

7176
allowed_tags: Tuple[str, ...] = (

tests/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class RepoActionStep(str, Enum):
9393
)
9494
EMOJI_COMMITS_MINOR = (
9595
*EMOJI_COMMITS_PATCH,
96-
":sparkles::pencil: docs for something special\n",
96+
":sparkles::memo: docs for something special\n",
9797
# Emoji in description should not be used to evaluate change type
9898
":sparkles: last minute rush order\n\nGood thing we're 10x developers :boom:\n",
9999
)

tests/unit/semantic_release/commit_parser/test_emoji.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,28 @@
4242
[":bug: Fixing a bug", "The bug is finally gone!"],
4343
[],
4444
),
45-
# No release
45+
# No release with specified emoji
4646
(
47-
":pencil: Documentation changes",
47+
":memo: Documentation changes",
48+
LevelBump.NO_RELEASE,
49+
":memo:",
50+
[":memo: Documentation changes"],
51+
[],
52+
),
53+
# No release with random emoji
54+
(
55+
":construction: Work in progress",
4856
LevelBump.NO_RELEASE,
4957
"Other",
50-
[":pencil: Documentation changes"],
58+
[":construction: Work in progress"],
5159
[],
5260
),
5361
# Multiple emojis
5462
(
55-
":sparkles::pencil: Add a feature and document it",
63+
":sparkles::memo: Add a feature and document it",
5664
LevelBump.MINOR,
5765
":sparkles:",
58-
[":sparkles::pencil: Add a feature and document it"],
66+
[":sparkles::memo: Add a feature and document it"],
5967
[],
6068
),
6169
# Emoji in description

0 commit comments

Comments
 (0)