22 releases

0.4.0 Feb 23, 2023
0.3.12 Sep 25, 2022
0.3.11 Jul 9, 2022
0.3.9 Mar 2, 2022
0.1.1 Dec 29, 2019

#13 in Build Utils

Download history 285/week @ 2022-11-30 156/week @ 2022-12-07 209/week @ 2022-12-14 99/week @ 2022-12-21 29/week @ 2022-12-28 255/week @ 2023-01-04 312/week @ 2023-01-11 263/week @ 2023-01-18 374/week @ 2023-01-25 348/week @ 2023-02-01 453/week @ 2023-02-08 423/week @ 2023-02-15 356/week @ 2023-02-22 258/week @ 2023-03-01 504/week @ 2023-03-08 451/week @ 2023-03-15

1,649 downloads per month

MIT license

110KB
2.5K SLoC

Convco

GitHub Workflow Status Crates.io

A Conventional commit cli.

Documentation: https://convco.github.io.

convco gives tools to work with Conventional Commits.

It provides the following commands:

  • convco changelog: Create a changelog file.
  • convco check: Checks if a range of commits is following the convention.
  • convco commit: Helps to make conventional commits.
  • convco version: Finds out the current or next version.

Installation

cargo install convco

This build depends on git2 with the zlib-ng-compat feature. It requires cmake.

Configuration

convco uses follows the conventional-changelog-config-spec.

The configuration file is loaded in the following order

  1. Load the internal defaults
  2. Then override with values from the command line, convco -c|--config path/to/.versionrc
  3. Or, if not specified via -c|--config, load ${PWD}/.versionrc if it exists.

To get the final derived configuration run convco config.

The host: ..., owner: ... and repository: ... when not supplied via custom or the .versionrc are loaded from the git remote origin value.

Docker usage

# build the convco image
docker build -t convco .
# run it on any codebase
docker run -v "$PWD:/tmp" --workdir /tmp --rm convco

or use it from the Docker Hub:

docker run -v "$PWD:/tmp" --workdir /tmp --rm convco/convco

Use it in .gitlab-ci.yml

If you've created an image and pushed it into your private registry

convco:check:
  stage: test
  image:
    name: convco/convco:latest
  script:
    - check

Tools

Changelog

A changelog can be generated using the conventional commits. It is inspired by conventional changelog and the configuration file allows changes to the generated the output.

convco changelog > CHANGELOG.md

Check

Check a range of revisions for compliance.

It returns a non zero exit code if some commits are not conventional. This is useful in a pre-push hook.

convco check $remote_sha..$local_sha

Commit

Helps to make conventional commits. A scope, description, body, breaking change and issues will be prompted.

# commit a new feature and then run git commit with the interactive patch switch
convco commit --feat -- --patch

Version

When no options are given it will return the current version. When --bump is provided, the next version will be printed out. Conventional commits are used to calculate the next major, minor or patch. If needed one can provide --major, --minor or --patch to overrule the convention.

convco version --bump

It is useful to use it with release tools, such as cargo-release:

cargo release $(convco version --bump)

Dependencies

~29MB
~645K SLoC