Skip to content

Commit

Permalink
fix(parser-angular): change Fixes commit type heading to Bug Fixes (
Browse files Browse the repository at this point in the history
#1064)

* test(fixtures): update expected changelog heading to `Bug Fixes`

* test(unit): update expected changelog heading to `Bug Fixes`
  • Loading branch information
codejedi365 authored Oct 18, 2024
1 parent 9dca116 commit 09e3a4d
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion semantic_release/commit_parser/angular.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _logged_parse_error(commit: Commit, error: str) -> ParseError:
"chore": "chores",
"docs": "documentation",
"feat": "features",
"fix": "fixes",
"fix": "bug fixes",
"perf": "performance improvements",
"refactor": "refactoring",
"style": "code style",
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/repos/git_flow/repo_w_2_release_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_commits_for_git_flow_repo_with_2_release_channels() -> GetRepoDefinition
},
"0.1.1-rc.1": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down Expand Up @@ -152,7 +152,7 @@ def get_commits_for_git_flow_repo_with_2_release_channels() -> GetRepoDefinition
},
"1.1.1": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down Expand Up @@ -209,8 +209,8 @@ def get_commits_for_git_flow_repo_with_2_release_channels() -> GetRepoDefinition
# But value is ultimately defined by the commits, which means the commits are
# referenced by index value
"angular": [
{"section": "Bug Fixes", "i_commits": [1]},
{"section": "Features", "i_commits": [0]},
{"section": "Fixes", "i_commits": [1]},
],
"emoji": [
{"section": ":bug:", "i_commits": [1]},
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/repos/git_flow/repo_w_3_release_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_commits_for_git_flow_repo_w_3_release_channels() -> GetRepoDefinitionFn:
},
"0.1.1-rc.1": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down Expand Up @@ -152,7 +152,7 @@ def get_commits_for_git_flow_repo_w_3_release_channels() -> GetRepoDefinitionFn:
},
"1.1.0-rc.2": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down Expand Up @@ -230,7 +230,7 @@ def get_commits_for_git_flow_repo_w_3_release_channels() -> GetRepoDefinitionFn:
},
"1.1.0-alpha.3": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_commits_for_github_flow_repo_w_feature_release_channel() -> GetRepoDefin
},
"0.1.1-rc.1": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/repos/trunk_based_dev/repo_w_no_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def get_commits_for_trunk_only_repo_w_no_tags() -> GetRepoDefinitionFn:
# But value is ultimately defined by the commits, which means the commits are
# referenced by index value
"angular": [
{"section": "Bug Fixes", "i_commits": [3, 1]},
{"section": "Features", "i_commits": [2]},
{"section": "Fixes", "i_commits": [3, 1]},
{"section": "Unknown", "i_commits": [0]},
],
"emoji": [
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/repos/trunk_based_dev/repo_w_prereleases.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_commits_for_trunk_only_repo_w_prerelease_tags() -> GetRepoDefinitionFn:
},
"0.1.1-rc.1": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/repos/trunk_based_dev/repo_w_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_commits_for_trunk_only_repo_w_tags() -> GetRepoDefinitionFn:
},
"0.1.1": {
"changelog_sections": {
"angular": [{"section": "Fixes", "i_commits": [0]}],
"angular": [{"section": "Bug Fixes", "i_commits": [0]}],
"emoji": [{"section": ":bug:", "i_commits": [0]}],
"scipy": [{"section": "Fix", "i_commits": [0]}],
"tag": [{"section": "Fix", "i_commits": [0]}],
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/semantic_release/changelog/test_changelog_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def changelog_tpl_github_context() -> str:
{{ "[Change Summary](%s)" | format("v1.0.0" | compare_url("v2.0.0")) }}
### Fixes
### Bug Fixes
- Fixed a minor bug {{ "([#%s](%s))" | format(22, 22 | pull_request_url) }}
- **cli:** fix a problem {{ "([%s](%s))" | format("000000", "000000" | commit_hash_url) }}
Expand All @@ -62,7 +62,7 @@ def changelog_tpl_gitea_context() -> str:
## v2.0.0
### Fixes
### Bug Fixes
- Fixed a minor bug {{ "([#%s](%s))" | format(22, 22 | pull_request_url) }}
- **cli:** fix a problem {{ "([%s](%s))" | format("000000", "000000" | commit_hash_url) }}
Expand All @@ -87,7 +87,7 @@ def changelog_tpl_gitlab_context() -> str:
{{ "[Change Summary](%s)" | format("v1.0.0" | compare_url("v2.0.0")) }}
### Fixes
### Bug Fixes
- Fixed a minor bug {{ "([#%s](%s))" | format(22, 22 | merge_request_url) }}
- Fixed a performance bug {{ "([#%s](%s))" | format(25, 25 | pull_request_url) }}
Expand All @@ -113,7 +113,7 @@ def changelog_tpl_bitbucket_context() -> str:
{{ "[Change Summary](%s)" | format("v1.0.0" | compare_url("v2.0.0")) }}
### Fixes
### Bug Fixes
- Fixed a minor bug {{ "([#%s](%s))" | format(22, 22 | pull_request_url) }}
- **cli:** fix a problem {{ "([%s](%s))" | format("000000", "000000" | commit_hash_url) }}
Expand Down Expand Up @@ -197,7 +197,7 @@ def test_changelog_context_bitbucket(
"",
f'[Change Summary]({hvcs.compare_url("v1.0.0", "v2.0.0")})',
"",
"### Fixes",
"### Bug Fixes",
"",
f"- Fixed a minor bug ([#22]({hvcs.pull_request_url(22)}))",
f'- **cli:** fix a problem ([000000]({hvcs.commit_hash_url("000000")}))',
Expand Down Expand Up @@ -241,7 +241,7 @@ def test_changelog_context_github(
"",
f'[Change Summary]({hvcs.compare_url("v1.0.0", "v2.0.0")})',
"",
"### Fixes",
"### Bug Fixes",
"",
f"- Fixed a minor bug ([#22]({hvcs.pull_request_url(22)}))",
f'- **cli:** fix a problem ([000000]({hvcs.commit_hash_url("000000")}))',
Expand Down Expand Up @@ -287,7 +287,7 @@ def test_changelog_context_gitea(
"",
"## v2.0.0",
"",
"### Fixes",
"### Bug Fixes",
"",
f"- Fixed a minor bug ([#22]({hvcs.pull_request_url(22)}))",
f'- **cli:** fix a problem ([000000]({hvcs.commit_hash_url("000000")}))',
Expand Down Expand Up @@ -335,7 +335,7 @@ def test_changelog_context_gitlab(
"",
f'[Change Summary]({hvcs.compare_url("v1.0.0", "v2.0.0")})',
"",
"### Fixes",
"### Bug Fixes",
"",
f"- Fixed a minor bug ([#22]({hvcs.merge_request_url(22)}))",
f"- Fixed a performance bug ([#25]({hvcs.pull_request_url(25)}))",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/semantic_release/commit_parser/test_angular.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_parser_returns_correct_bump_level(
"message, type_",
[
("feat(parser): ...", "features"),
("fix(parser): ...", "fixes"),
("fix(parser): ...", "bug fixes"),
("test(parser): ...", "testing"),
("docs(parser): ...", "documentation"),
("style(parser): ...", "code style"),
Expand Down

0 comments on commit 09e3a4d

Please sign in to comment.