Commitizen tools plugin with Espressif code style
Project description
Introduction
This is a plugin for Commitizen that makes it easy to create and maintain a well-organized and good-looking CHANGELOG.md
.
It also takes care of version bumping and helps you write commit messages that follow Espressif standards.
All of this with minimal config and setup, so your pyproject.toml
file stays clean and simple.
Install
Of course, you have already created and activated a Python virtual environment... then:
pip install czespressif
.... and add snippet from Minimal setup - that's it 🤝.
You can also add it to your project dev
dependencies (suggested) and run the sync command (pipenv sync
, pip-sync
, poetry install
, ...).
Commitizen itself is in the plugin's dependencies, so pip will take care of everything.
[!WARNING] Don't try to install it system-wide with
pipx
.This is a plugin, and that's probably not going to work as you expect.
Build Changelog
If a changelog already exists in your project, make sure you have staged or committed its latest version.
This command turns your old changelog into a nicely organized template based on the Keep Changelog standard.
cz changelog
Bump Release version
Is better to first run:
cz bump --dry-run
This only shows the future version and the part of the changelog that will be updated. When all ok, do the same without --dry-run
flag.
Write commit message
In case anyone actually prefers this way of creating commit messages, the command:
cz commit
in this plugin is aligned with the Espressif commit linter and DangerJS linters. You can give it a try...
? Select the type of change you are committing (Use arrow keys)
» feat ✨ A new feature
fix 🐛 A bug fix
change 🏗️ A change made to the codebase.
docs 📖 Documentation only change
test 🚦 Adding missing or correcting existing tests
ci ⚙️ Changes to CI configuration files and scripts
refactor 🔧 A changeset neither fixing a bug nor adding a feature
revert 🔙 Revert one or more commits
remove 🗑️ Removing code or files
Example
If you are unsure about the commit message standard, hit:
cz example
This will bring up a complete example of good commit messages and commit schema in the terminal.
Configuration
Config is accepted in pyproject.toml
(priority, following example), .cz.toml
, .cz.json
, cz.json
, .cz.yaml
, cz.yaml
, and cz.toml
.
Minimal setup
[!TIP] Try to be minimalistic with custom configs. The best approach is to keep the defaults, so all Espressif projects maintain the same look and feel. Also, you will save yourself troubles with non-standard setups.
[tool.commitizen]
name = "czespressif"
bump_message = 'change(bump): release $current_version → $new_version [skip-ci]'
Optimal setup
[tool.commitizen]
name = "czespressif"
bump_message = 'change(bump): release $current_version → $new_version [skip-ci]'
# see commitizen docs, following are standard configs
annotated_tag = true
changelog_merge_prerelease = true
tag_format = "v$version"
update_changelog_on_bump = true
Additional configurable parameters
[tool.commitizen]
...
changelog_title = "Our changelog" # custom text of changelog title
changelog_header = "This is our changelog.\nAll cool things we do are here.\n\nPlease read it." # custom text of changelog header
changelog_footer = "This is the end of our changelog.\n\nMore cool things are coming." # custom text of changelog footer
changelog_section_line = false # default (true); false = removes horizontal lines between releases
changelog_unreleased = false # default (true); false = removes section Unreleased, keeps only releases
changelog_show_authors = false # default (true); false = removes authors of the changes (commit)
changelog_show_commits = false # default (true); false = removes commit short sha of the changes
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',
'⚙️ 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
use_emoji = false # default (true); false = removes emojis from changelog and commit UI (emojis are never added in the commit messages)
[[tool.commitizen.extra_types]] # add extra types for 'cz commit' and changelog
type = "style"
heading = "Code Style"
emoji = "🎨"
description = "Changes that do not affect the meaning of the code (white-space, formatting, etc.)"
bump = "PATCH"
changelog = true
Contributing
We welcome contributions from the community! Please read the Contributing Guide to learn how to get involved.
License
This repository is licensed under the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for czespressif-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5a74ba0538de9038d232806ee546532c448f84defad761ba25b1e2526a7809c |
|
MD5 | fc8c2e6060b06dc102c90a135ed3cfd7 |
|
BLAKE2b-256 | e816ac10f8b0e6e68ae879138a82583ef13cb585377a05bd3013efb858fcf73b |