commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

feat: pre-release seperated changelog

Open nbrugger-tgm opened this issue 4 years ago • 0 comments

Description

Adds 2 parameters :

  • --separate-pre-changelog : use a separate changelog for each type of pre-release
  • --separate-pre-releases : changes in the changelog will always relate to the latest release of the same pre-release type

(and their respective implementation)

Checklist

  • [ ] Add test cases to all the changes you introduce
  • [ ] Run ./script/format and ./script/test locally to ensure this change passes linter check and test
  • [ ] Test the changes on the local machine manually
  • [ ] Update the documentation for the changes

Expected behavior

When --separate-pre-releases is used entries (features and fixes) should appear in a release even if they technicaly belong to a pre release

When --separate-pre-changelog is used a changelog for each pre-release type should exist and be maintained by cz.

Steps to Test This Pull Request

(cz being my modified version)

mkdir test
cd test
git init
echo "{ \"commitizen\": { \"name\": \"cz_conventional_commits\", \"version\": \"0.1.0\",\"tag_format\": \"$version\",\"update_changelog_on_bump\": true } }" >> cz.json
touch f1
git add .
git commit -m "feat: 1"
cz bump

touch f2
git add .
git commit -m "feat: 2"
cz bump -pr beta
cz bump -pr rc --separate-pre-releases

touch fix
git add .
git commit -m "fix: 3"
cz bump --separate-pre-releases

Expected:

The CHANGELOG.md should look like this:

## 0.3.0
### Feat
* 2
### Fix
* 3

## 0.3.0rc0
### Feat
* 2

## 0.3.0b0
### Feat
* 2

## 0.2.0
### Feat
* 1

Additional context

This issue is kind of a draft, as i found no guidance of how to contribute.

While the PR template tells me what to do i do now know how. I cannot execute the above testcases as when i run python3 __main__.py the imports use my local installation of comittizen (using venv and also not using venv) instead of my modified code. I also do not rly know what how to write or execute test cases. do i need to remove my local installation and do something like pip install my repo?

I would love to contribute hight quality (well tested and documented etc) but as there is no documentation of how to contribute, I am a little stuck. (i followed the instructions in docs/contributing.md)

If you would be so kind to provide some basic information and feedback i would check all the requirements.

(Some of this issues might be related to my very little development experience in python as i never dealt with package management etc. but I think a person should be able to contribute without greater knowledge about the eco-system)

Adresses issues

  • https://github.com/commitizen-tools/commitizen/issues/415
  • https://github.com/commitizen-tools/commitizen/issues/364

nbrugger-tgm avatar Dec 05 '21 02:12 nbrugger-tgm