Skip to content

Fix/adjust formatting headers in changelog #1182

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

Merged
10 changes: 5 additions & 5 deletions config/release-templates/.components/changes.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ EXAMPLE:
- Fix bug ([#11](https://domain.com/namespace/repo/pull/11),
[`abcdef1`](https://domain.com/namespace/repo/commit/HASH))

### 💥 BREAKING CHANGES
### 💥 Breaking Changes

- With the change _____, the change causes ___ effect. Ultimately, this section
it is a more detailed description of the breaking change. With an optional
Expand All @@ -28,7 +28,7 @@ EXAMPLE:
- **scope**: this breaking change has a scope to identify the part of the code that
this breaking change applies to for better context.

### 💡 ADDITIONAL RELEASE INFORMATION
### 💡 Additional Release Information

- This is a release note that provides additional information about the release
that is not a breaking change or a feature/bug fix.
Expand Down Expand Up @@ -65,7 +65,7 @@ EXAMPLE:
#}{% set breaking_commits = []
%}{% set notice_commits = []
%}{% for commits in commit_objects.values()
%}{% set valid_commits = commits | rejectattr("error", "defined")
%}{% set valid_commits = commits | rejectattr("error", "defined") | list
%}{# # Filter out breaking change commits that have no breaking descriptions
#}{% set _ = breaking_commits.extend(
valid_commits | selectattr("breaking_descriptions.0")
Expand Down Expand Up @@ -94,7 +94,7 @@ EXAMPLE:
%}{#
# # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions)
#}{{ "\n"
}}{{ "### %s BREAKING CHANGES\n" | format(emoji_map["breaking"])
}}{{ "### %s Breaking Changes\n" | format(emoji_map["breaking"])
}}{{
"\n%s\n" | format(brking_descriptions | unique | join("\n\n"))
}}{#
Expand All @@ -118,7 +118,7 @@ EXAMPLE:
%}{#
# # PRINT RELEASE NOTICE INFORMATION (header & descriptions)
#}{{ "\n"
}}{{ "### %s ADDITIONAL RELEASE INFORMATION\n" | format(emoji_map["release_note"])
}}{{ "### %s Additional Release Information\n" | format(emoji_map["release_note"])
}}{{
"\n%s\n" | format(release_notices | unique | join("\n\n"))
}}{#
Expand Down
8 changes: 4 additions & 4 deletions config/release-templates/.components/changes.rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

* Fix bug (`#11`_, `8a7b8ec`_)

💥 BREAKING CHANGES
💥 Breaking Changes
-------------------

* With the change _____, the change causes ___ effect. Ultimately, this section
Expand All @@ -30,7 +30,7 @@
* **scope**: this breaking change has a scope to identify the part of the code that
this breaking change applies to for better context.

💡 ADDITIONAL RELEASE INFORMATION
💡 Additional Release Information
---------------------------------

* This is a release note that provides additional information about the release
Expand Down Expand Up @@ -132,7 +132,7 @@
%}{#
# # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions)
#}{{ "\n"
}}{{ "%s BREAKING CHANGES\n" | format(emoji_map["breaking"])
}}{{ "%s Breaking Changes\n" | format(emoji_map["breaking"])
}}{{ '-------------------\n'
}}{{
"\n%s\n" | format(brking_descriptions | unique | join("\n\n"))
Expand All @@ -157,7 +157,7 @@
%}{#
# # PRINT RELEASE NOTICE INFORMATION (header & descriptions)
#}{{ "\n"
}}{{ "%s ADDITIONAL RELEASE INFORMATION\n" | format(emoji_map["release_note"])
}}{{ "%s Additional Release Information\n" | format(emoji_map["release_note"])
}}{{ "---------------------------------\n"
}}{{
"\n%s\n" | format(release_notices | unique | join("\n\n"))
Expand Down
4 changes: 2 additions & 2 deletions config/release-templates/.release_notes.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ _This release is published under the MIT License._

- Fix bug ([PR#11](https://domain.com/namespace/repo/pull/11), [`abcdef1`](https://domain.com/namespace/repo/commit/HASH))

### 💥 BREAKING CHANGES
### 💥 Breaking Changes

- With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional scope prefix like the commit messages above.

- **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context.

### 💡 ADDITIONAL RELEASE INFORMATION
### 💡 Additional Release Information

- This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix.

Expand Down
2 changes: 1 addition & 1 deletion docs/commit_parsing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ a ``release_notices`` attribute that is a tuple of string paragraphs to identify
release notice.

In the default changelog and release notes template, these release notices will be
formatted into their own section called **ADDITIONAL RELEASE INFORMATION**. Each will
formatted into their own section called **Additional Release Information**. Each will
include any commit scope defined and each release notice in alphabetical order.

----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ EXAMPLE:
- Fix bug ([#11](https://domain.com/namespace/repo/pull/11),
[`abcdef1`](https://domain.com/namespace/repo/commit/HASH))

### BREAKING CHANGES
### Breaking Changes

- With the change _____, the change causes ___ effect. Ultimately, this section
it is a more detailed description of the breaking change. With an optional
Expand All @@ -27,7 +27,7 @@ EXAMPLE:
- **scope**: this breaking change has a scope to identify the part of the code that
this breaking change applies to for better context.

### ADDITIONAL RELEASE INFORMATION
### Additional Release Information

- This is a release note that provides additional information about the release
that is not a breaking change or a feature/bug fix.
Expand Down Expand Up @@ -96,7 +96,7 @@ EXAMPLE:
%}{#
# # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions)
#}{{ "\n"
}}{{ "### BREAKING CHANGES\n"
}}{{ "### Breaking Changes\n"
}}{{
"\n%s\n" | format(brking_descriptions | unique | join("\n\n"))
}}{#
Expand Down Expand Up @@ -129,7 +129,7 @@ EXAMPLE:
%}{#
# # PRINT RELEASE NOTICE INFORMATION (header & descriptions)
#}{{ "\n"
}}{{ "### ADDITIONAL RELEASE INFORMATION\n"
}}{{ "### Additional Release Information\n"
}}{{
"\n%s\n" | format(release_notices | unique | join("\n\n"))
}}{#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ _This release is published under the MIT License._

- Fix bug (#11, [`abcdef1`](https://domain.com/namespace/repo/commit/HASH))

### BREAKING CHANGES
### Breaking Changes

- With the change _____, the change causes ___ effect. Ultimately, this section it is a more detailed description of the breaking change. With an optional scope prefix like the commit messages above.

- **scope**: this breaking change has a scope to identify the part of the code that this breaking change applies to for better context.

### ADDITIONAL RELEASE INFORMATION
### Additional Release Information

- This is a release note that provides additional information about the release that is not a breaking change or a feature/bug fix.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Bug Fixes

* Fix bug (`#11`_, `8a7b8ec`_)

BREAKING CHANGES
Breaking Changes
----------------

* With the change _____, the change causes ___ effect. Ultimately, this section
Expand All @@ -28,7 +28,7 @@ BREAKING CHANGES
* **scope**: this breaking change has a scope to identify the part of the code that
this breaking change applies to for better context.

ADDITIONAL RELEASE INFORMATION
Additional Release Information
------------------------------

* This is a release note that provides additional information about the release
Expand Down Expand Up @@ -124,7 +124,7 @@ ADDITIONAL RELEASE INFORMATION
%}{#
# # PRINT BREAKING CHANGE DESCRIPTIONS (header & descriptions)
#}{{ "\n"
}}{{ "BREAKING CHANGES\n"
}}{{ "Breaking Changes\n"
}}{{ '----------------\n'
}}{{
"\n%s\n" | format(brking_descriptions | unique | join("\n\n"))
Expand Down Expand Up @@ -158,7 +158,7 @@ ADDITIONAL RELEASE INFORMATION
%}{#
# # PRINT RELEASE NOTICE INFORMATION (header & descriptions)
#}{{ "\n"
}}{{ "ADDITIONAL RELEASE INFORMATION\n"
}}{{ "Additional Release Information\n"
}}{{ "------------------------------\n"
}}{{
"\n%s\n" | format(release_notices | unique | join("\n\n"))
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/git_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ def build_version_entry_markdown(

# Add breaking changes to the end of the version entry
if brking_descriptions:
version_entry.append("### BREAKING CHANGES\n")
version_entry.append("### Breaking Changes\n")
version_entry.extend([*sorted(brking_descriptions), ""])

return str.join("\n", version_entry)
Expand Down Expand Up @@ -1822,7 +1822,7 @@ def build_version_entry_restructured_text(

# Add breaking changes to the end of the version entry
if brking_descriptions:
version_entry.append("BREAKING CHANGES")
version_entry.append("Breaking Changes")
version_entry.append("-" * len(version_entry[-1]) + "\n")
version_entry.extend([*sorted(brking_descriptions), ""])

Expand Down Expand Up @@ -2067,7 +2067,7 @@ def build_version_entry_markdown(

# Add breaking changes to the end of the version entry
if brking_descriptions:
version_entry.append("### BREAKING CHANGES\n")
version_entry.append("### Breaking Changes\n")
version_entry.extend([*sorted(brking_descriptions), ""])

return str.join("\n", version_entry)
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/semantic_release/changelog/test_default_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_default_changelog_template_w_a_brk_change(
f"- **{brk_fix_commit_obj.scope}**: {brk_fix_description.capitalize()}",
f" ([`{brk_fix_commit_obj.commit.hexsha[:7]}`]({brk_fix_commit_url}))",
"",
"### BREAKING CHANGES",
"### Breaking Changes",
"",
# Currently does not consider the 100 character limit because the current
# descriptions are short enough to fit in one line
Expand Down Expand Up @@ -317,7 +317,7 @@ def test_default_changelog_template_w_multiple_brk_changes(
f"- {brk_feat_description.capitalize()}",
f" ([`{brk_feat_commit_obj.commit.hexsha[:7]}`]({brk_feat_commit_url}))",
"",
"### BREAKING CHANGES",
"### Breaking Changes",
"",
# Currently does not consider the 100 character limit because the current
# descriptions are short enough to fit in one line
Expand Down Expand Up @@ -638,7 +638,7 @@ def test_default_changelog_template_w_a_notice(
f"- **{notice_commit_obj.scope}**: {notice_commit_description.capitalize().rstrip()}",
f" ([`{notice_commit_obj.commit.hexsha[:7]}`]({notice_commit_url}))",
"",
"### ADDITIONAL RELEASE INFORMATION",
"### Additional Release Information",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down Expand Up @@ -787,7 +787,7 @@ def test_default_changelog_template_w_a_notice_n_brk_change(
),
f" ([`{notice_commit_obj.commit.hexsha[:7]}`]({notice_commit_url}))",
"",
"### BREAKING CHANGES",
"### Breaking Changes",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand All @@ -798,7 +798,7 @@ def test_default_changelog_template_w_a_notice_n_brk_change(
change_desc=brk_fix_brking_description.capitalize().rstrip(),
),
"",
"### ADDITIONAL RELEASE INFORMATION",
"### Additional Release Information",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down Expand Up @@ -947,7 +947,7 @@ def test_default_changelog_template_w_multiple_notices(
),
f" ([`{refactor_notice_commit_obj.commit.hexsha[:7]}`]({refactor_commit_url}))",
"",
"### ADDITIONAL RELEASE INFORMATION",
"### Additional Release Information",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/semantic_release/changelog/test_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_default_release_notes_template_w_a_brk_description(
url=brk_fix_commit_url,
),
"",
"### BREAKING CHANGES",
"### Breaking Changes",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down Expand Up @@ -323,7 +323,7 @@ def test_default_release_notes_template_w_multiple_brk_changes(
url=brk_feat_commit_url,
),
"",
"### BREAKING CHANGES",
"### Breaking Changes",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down Expand Up @@ -770,7 +770,7 @@ def test_default_release_notes_template_w_a_notice(
url=notice_commit_url,
),
"",
"### ADDITIONAL RELEASE INFORMATION",
"### Additional Release Information",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down Expand Up @@ -880,7 +880,7 @@ def test_default_release_notes_template_w_a_notice_n_brk_change(
url=notice_commit_url,
),
"",
"### BREAKING CHANGES",
"### Breaking Changes",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand All @@ -891,7 +891,7 @@ def test_default_release_notes_template_w_a_notice_n_brk_change(
change_desc=brk_fix_brking_description.capitalize().rstrip(),
),
"",
"### ADDITIONAL RELEASE INFORMATION",
"### Additional Release Information",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down Expand Up @@ -997,7 +997,7 @@ def test_default_release_notes_template_w_multiple_notices(
url=refactor_commit_url,
),
"",
"### ADDITIONAL RELEASE INFORMATION",
"### Additional Release Information",
"",
"- {commit_scope}{change_desc}".format(
commit_scope=(
Expand Down
Loading