Conventional

build Coverage Status Pub

A lightweight library for working with commits that follow the Conventional Commits specification.

Features

  • Commit.parseCommits() for parsing commits from a git --no-pager log --no-decorate command output.
  • hasReleasableCommits() for checking if a list Commit items has releasable commits following the convention.
  • writeChangelog() for automated authoring of CHANGELOGs based on commits that follow the conventional commits spec.
  • lintCommit() for checking whether commit messages follow the conventional commit spec. Useful when used alongside git_hooks.
  • nextVersion() for bumping to a next version based on releasable commits.

Usage

A simple usage example:

import 'package:conventional/conventional.dart';

main() {
  final List<Commit> commits = Commit.parseCommits(testLog);
  if (hasReleasableCommits(commits)) {
    writeChangelog(
      commits: commits,
      changelogFilePath: 'CHANGELOG.md',
      version: '1.2.0',
      now: DateTime.now(),
    );
  }
}

Feature Requests and Bugs

Please file feature requests and bugs at the issue tracker. PR's are welcome and appreciated!

Other Solutions

Libraries

conventional