Skip to content
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

docs(changelog): add commitizen template #356

Merged
merged 1 commit into from
Feb 13, 2024
Merged
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
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ Project maintainers are responsible for releasing new versions of pycytominer.
Creating a new release includes the following steps:

1. Create a new branch from `main` for the release (e.g. `release-v1.0.0`)
2. Run the command `cz bump --files-only` to update the version number in `CITATION.cff` and `pyproject.toml:tool.commitizen`.
3. Review the changes to CHANGELOG.md and edit as needed.
4. Review the [commit history](https://github.com/cytomining/pycytominer/compare) from the last release and add documentation for changes that weren't auto-included because they didn't follow the conventional-commit standard.
5. `git add` all changes and run `cz bump` to create the release commit.
2. Review the [commit history](https://github.com/cytomining/pycytominer/compare) from the last release and check whether it includes commits that don't follow the [conventional commit standard](https://www.conventionalcommits.org/en/v1.0.0/#summary).
If all changes follow conventional commits, skip to step 5.
3. Run the command `cz bump --files-only` to update the version number in `CITATION.cff` and `pyproject.toml:tool.commitizen` and generate the draft changelog.
4. Review the changes to `CHANGELOG.md`. If necessary, add descriptions of missing changes and modify descriptions to match conventional commits standard.
5. `git add` any manual changes and run `cz bump` to create the release commit.
Push the changes to the release branch.
6. Create a pull request for the release branch into `main`.
7. Request a review from another maintainer.
8. Once the pull request is approved, merge it into `main`.
Expand Down
23 changes: 23 additions & 0 deletions dev_tools/commitizen/CHANGELOG.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{# Adapted from https://github.com/commitizen-tools/commitizen/blob/1d842b5d823a452109070f8af8857249e95f7713/commitizen/templates/CHANGELOG.md.j2 #}
{% for entry in tree %}

## {{ entry.version }}{% if entry.date %} ({{ entry.date }}){% endif %}

{# Add link to the detailed GitHub release notes #}
[Detailed Release Notes](https://github.com/cytomining/pycytominer/releases/tag/{{ entry.version }})

{% for change_key, changes in entry.changes.items() %}

{% if change_key %}
### {{ change_key }}
{% endif %}

{% for change in changes %}
{% if change.scope %}
- **{{ change.scope }}**: {{ change.message }}
{% elif change.message %}
- {{ change.message }}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ tag_format = "v$version"
version_scheme = "pep440"
version_provider = "commitizen"
update_changelog_on_bump = true
template = "dev_tools/commitizen/CHANGELOG.md.j2"
version_files = [
"CITATION.cff"
]
Expand Down
Loading