Skip to content

Commit

Permalink
fix(changelog): fixed default sections order in changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
tomassebestik committed Sep 8, 2024
1 parent 3d2f2a7 commit f7fd3fb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 29 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,32 @@ Config is accepted in `pyproject.toml` (priority, following example), `.cz.toml`
changelog_section_line = false # default (true); false = removes horizontal lines between releases
changelog_unreleased = false # default (true); false = removes section Unreleased, keeps only releases

change_type_order = [ # in which order sections goes in changelog; if you use emojis include them
'🏗️ Changes',
'🐛 Bug fixes',
change_type_order = [ # in which order sections goes in changelog; if you use emojis include them | this here is default order
'🚨 Breaking changes',
'✨ New features',
'🐛 Bug fixes',
'📖 Documentation',
'🏗️ Changes',
'🔧 Refactoring',
'🗑️ Removals',
'🎨 Code Style',
'⚙️ CI and project settings',
'🚦 Testing',
'🔙 Reverted',
]

change_type_order = [ # same, with disabled emojis | this here is default order
'Breaking changes',
'New features',
'Bug fixes',
'Documentation',
'Changes',
'Refactoring',
'Removals',
'CI and project settings',
'Testing',
'Reverted',
]

change_type_map = # dependent on mapping in default types, only types with "changelog = True"
types_in_changelog = ["feat", "fix", "refactor", "style", "ci"] # redefine which types are shown in changelog

Expand Down
53 changes: 28 additions & 25 deletions czespressif/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Dict
from typing import List

TYPES: List[Dict] = [
TYPES: List[Dict] = [ # this is order in changelog
{
'type': 'BREAKING CHANGE',
'description': 'Changes that are not backward-compatibles',
Expand All @@ -31,6 +31,14 @@
'bump': 'PATCH',
'changelog': True,
},
{
'type': 'docs',
'description': 'Documentation only change',
'heading': 'Documentation',
'emoji': '📖',
'bump': 'PATCH',
'changelog': True,
},
{
'type': 'change',
'description': 'A change made to the codebase.',
Expand All @@ -40,20 +48,20 @@
'changelog': True,
},
{
'type': 'docs',
'description': 'Documentation only change',
'heading': 'Documentation',
'emoji': '📖',
'type': 'refactor',
'description': 'A changeset neither fixing a bug nor adding a feature',
'heading': 'Refactoring',
'emoji': '🔧',
'bump': 'PATCH',
'changelog': True,
'changelog': False,
},
{
'type': 'test',
'description': 'Adding missing or correcting existing tests',
'heading': 'Testing',
'emoji': '🚦',
'type': 'remove',
'description': 'Removing code or files',
'heading': 'Removals',
'emoji': '🗑️',
'bump': 'PATCH',
'changelog': False,
'changelog': True,
},
{
'type': 'ci',
Expand All @@ -64,10 +72,10 @@
'changelog': False,
},
{
'type': 'refactor',
'description': 'A changeset neither fixing a bug nor adding a feature',
'heading': 'Refactoring',
'emoji': '🔧',
'type': 'test',
'description': 'Adding missing or correcting existing tests',
'heading': 'Testing',
'emoji': '🚦',
'bump': 'PATCH',
'changelog': False,
},
Expand All @@ -79,20 +87,13 @@
'bump': 'PATCH',
'changelog': False,
},
{
'type': 'remove',
'description': 'Removing code or files',
'heading': 'Removals',
'emoji': '🗑️',
'bump': 'PATCH',
'changelog': True,
},
]

CHANGELOG_TITLE: str = 'Changelog'

CHANGELOG_HEADER: str = """
> [!NOTE]
CHANGELOG_HEADER: str = (
r'> \[!NOTE\]'
"""
> All notable changes to this project are documented in this file. The list is not exhaustive,
> typically, only important changes, fixes, and new features in the code are reflected here.
Expand All @@ -101,11 +102,13 @@
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)</sub>
---"""
)


CHANGELOG_FOOTER: str = f"""**[Espressif Systems CO LTD. ({datetime.now().year})](https://www.espressif.com/)**
- [Commitizen tools plugin with Espressif code style](https://www.github.com/espressif/cz-plugin-espressif)
- [Espressif Coding Standards and Best Practices](https://www.github.com/espressif/standards)"""


# Currently BUMP_MESSAGE not possible to define default here - if not provided from pyproject.toml, it will be commitizen default, not ours :(
BUMP_MESSAGE: str = 'change(bump): release $current_version → $new_version [skip-ci]'

0 comments on commit f7fd3fb

Please sign in to comment.