Skip to main content

A command line tool to handle changelogs using Git commit messages

Project description

braulio

https://img.shields.io/pypi/v/braulio.svg https://img.shields.io/travis/mbarakaja/braulio.svg Documentation Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

braulio-0.3.0b0.tar.gz (33.2 kB view hashes)

Uploaded Source

Built Distribution

braulio-0.3.0b0-py2.py3-none-any.whl (14.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page