A command line tool to handle changelogs using Git commit messages
Project description
braulio
Simplify software release by handling version bump and updating changelog file.
Braulio inspects each commit message and determines the next version to be released based on a couple of conventions. Each commit message must have a label with metadata information about the action and optionally the scope of the code being introduced.
Commit message convention
Braulio looks for commits that follow a given convention. The convention is defined by setting up the options label_pattern and label_position, which are available through the CLI tool also.
- label_position =
The posible values are header or footer (default). This option tell to Braulio where to look for metatada information.
- label_pattern =
This is not a regular expression, but instead is a pattern using placeholders, where each placeholder represents a metadata information that should be extracted from the commit message. The available placeholders are {action}, {scope} and {subject}. {action} are always required, {scope} is optional and {subject} is required only if label_position is set to header. Everything else is treated in a literal way.
Examples
Given the next setup.cfg file:
[braulio]
label_position = header
label_pattern = [{action}] {subject}
The config above defines that the label must be localed in the header of the commit message and must meet the pattern [{action}] {subject}. The next commit message header must match the pattern:
[feat] Add music please
Ok, I am going to change it
The commit matches the message convention and the extracted information is:
{
'action': 'feat',
'scope': None,
'subject': 'Add music please'
}
If the label is located in the footer, {subject} must be ommited since the entire header will be used as the subject value.
Custom Git tag names
CLI |
Config File |
Default |
--tag--patern |
tag_pattern |
v{version} |
Pattern used to get and add release git tags. This is not a regular expression, Instead it must have the placehold field version surrounded by curly braces. The placeholder determines where a version string is located in a given tag name. Anything that is not contained in braces is considered literal text.
Example
In order to match the tag release-1.0.0, release-3 and release-35.2, the pattern must be release-{version}. As stated above, any time a new version is released, the same pattern will be used as template to generate the new Git tag name. The new version string will fill the {version} placeholder.
Custom release commit message
If the release commit is enabled, this is used for the message.
CLI |
Config File |
Default |
---|---|---|
--message |
message |
Release version {new_version} |
This is a template string containing replacement fields. The available fields are {new_version} and {current_version}. {new_version} is always mandatory, while {current_version}
Installing
Install and update using pip:
$ pip install -U braulio
Usage
$ brau --help
Free software: MIT license
History
0.3.0b0 (2018-08-14)
Bug Fixes
release
Abort when a lower version is passed to –bump
Stop aborting when user inputs No to confirmation prompt
Ensure –bump works with versions without minor and patch parts.
Validate tag_pattern value
git - Fix Tag’s __repr__ and __str__ methods
Features
release
Support pre-release versions
Add option to customize the commit message
Add option to specify the current version
Add support to custom git tag names
Add support to custom commit message conventions
cli - Add –version option to output current version
0.2.0 (2018-07-25)
Bug Fixes
changelog - Fix release markup being inserted in the wrong place
Features
release
Show useful info while running release subcommand
Add support to custom change log file names
Support version string update on selected files
init - Add interactive config and changelog files creation
0.1.0 (2018-07-13)
Features
release
Add –no-commit and –no-tag options
Add options for manual version bump
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 braulio-0.3.0b0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8707a38c2050ef5f55c06aaaf06832b26c581beeb52ca0ae250ef2a4f21bab |
|
MD5 | f6d1572a127d19f3b1e7ee5853db8a47 |
|
BLAKE2b-256 | 0c2233d429c5676535adbdd17f3bc0578bf3f0659ebcfec2e6b5a94b6ed0725f |