commitizen
commitizen copied to clipboard
Changelog change type sections are ordered "incorrectly"
Description
The default value for change_type_order
uses lower-case "feat", "perf", etc instead of "Feat", "Perf", and is therefore ignored in changelog output
Steps to reproduce
-
mkdir /tmp/cztest && cd /tmp/cztest
-
git init
-
touch foo && git add foo && git commit -m "feat: first commit"
-
touch foo2 && git add foo2 && git commit -m "perf: second commit"
-
cz ch --dry-run
-
echo -e "[tool.commitizen]\nchange_type_order = [\"Feat\", \"Perf\"]" > pyproject.toml
-
cz ch --dry-run
Current behavior
The default change_type_order is ineffective and pre #323 LIFO ordering is used in the changelog
Desired behavior
Changelog sections should be ordered according to https://github.com/commitizen-tools/commitizen/blob/master/commitizen/defaults.py#L43
Environment
- commitizen version: 2.17.12
- python version: 3.6.9
- operating system: Linux
I'm not positive, but as far as I can tell, this only is in effect when using cz_conventional_commits and is caused by the change_type_map which maps "perf" to "Perf", etc here: https://github.com/commitizen-tools/commitizen/blob/aa0debe9ae5939afb54de5f26c7f0c395894e330/commitizen/cz/conventional_commits/conventional_commits.py#L35-L40
An alternate fix to the PR I submitted might be to just change/remove this change_type_map, but I have not tested this (nor do I know if this would somehow break conventional commits convention or be otherwise undesirable).
closed by #403