Skip to content
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
2 changes: 1 addition & 1 deletion src/semantic_release/commit_parser/conventional/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ConventionalCommitParser(
str.join(
"",
[
r"^(?:clos(?:e|es|ed|ing)|fix(?:es|ed|ing)?|resolv(?:e|es|ed|ing)|implement(?:s|ed|ing)?):",
r"^(?:clos(?:e|es|ed|ing)|fix(?:es|ed|ing)?|resolv(?:e|es|ed|ing)|implement(?:s|ed|ing)?|ref(?:s|ered|erence|ering)?):",
r"[\t ]+(?P<issue_predicate>.+)[\t ]*$",
],
),
Expand Down
10 changes: 10 additions & 0 deletions tests/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class RepoActionStep(str, Enum):

COMMIT_MESSAGE = "{version}\n\nAutomatically generated by python-semantic-release\n"


SUPPORTED_ISSUE_CLOSURE_PREFIXES = [
"Close",
"Closes",
Expand All @@ -66,6 +67,15 @@ class RepoActionStep(str, Enum):
"Implementing",
]

SUPPORTED_ISSUE_PREFIXES = [
*SUPPORTED_ISSUE_CLOSURE_PREFIXES,
"Ref",
"Refs",
"Refered",
"Reference",
"Refering",
]

CONVENTIONAL_COMMITS_CHORE = ("ci: added a commit lint job\n",)
# Different in-scope commits that produce a certain release type
CONVENTIONAL_COMMITS_PATCH = (
Expand Down
20 changes: 3 additions & 17 deletions tests/unit/semantic_release/commit_parser/test_conventional.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from semantic_release.commit_parser.token import ParsedCommit, ParseError
from semantic_release.enums import LevelBump

from tests.const import SUPPORTED_ISSUE_CLOSURE_PREFIXES
from tests.const import SUPPORTED_ISSUE_PREFIXES

if TYPE_CHECKING:
from tests.conftest import MakeCommitObjFn
Expand Down Expand Up @@ -753,7 +753,7 @@ def test_parser_return_linked_merge_request_from_commit_message(
f"feat(parser): add magic parser\n\n{footer}",
linked_issues,
)
for footer_prefix in SUPPORTED_ISSUE_CLOSURE_PREFIXES
for footer_prefix in SUPPORTED_ISSUE_PREFIXES
for footer, linked_issues in [
# Single issue
(
Expand Down Expand Up @@ -855,13 +855,6 @@ def test_parser_return_linked_merge_request_from_commit_message(
(f"{footer_prefix} #666, {footer_prefix} #777", []),
# Invalid 'and' separation
(f"{footer_prefix}: #666and#777", ["#666and#777"]),
# Invalid prefix
("ref: #666", []),
# body mentions an issue and has a different git footer
(
"In #666, the devils in the details...\n\nSigned-off-by: johndoe <johndoe@mail.com>",
[],
),
]
],
*[
Expand All @@ -870,7 +863,7 @@ def test_parser_return_linked_merge_request_from_commit_message(
f"feat(parser): add magic parser\n\n{footer}",
linked_issues,
)
for footer_prefix in SUPPORTED_ISSUE_CLOSURE_PREFIXES
for footer_prefix in SUPPORTED_ISSUE_PREFIXES
for footer, linked_issues in [
# Single issue
(
Expand Down Expand Up @@ -984,13 +977,6 @@ def test_parser_return_linked_merge_request_from_commit_message(
(f"{footer_prefix} ABC-666, {footer_prefix} ABC-777", []),
# Invalid 'and' separation
(f"{footer_prefix}: ABC-666andABC-777", ["ABC-666andABC-777"]),
# Invalid prefix
("ref: ABC-666", []),
# body mentions an issue and has a different git footer
(
"In ABC-666, the devils in the details...\n\nSigned-off-by: johndoe <johndoe@mail.com>",
[],
),
]
],
*[
Expand Down
Loading