danger-changelog

A plugin for danger.systems that obsessive-compulsively lints your project’s CHANGELOG.md. It can make sure, for example, that changes are attributed properly, have a valid version number, a date in the ISO8601 format, balanced parenthesis and brackets, and that they’re always terminated with a period.

Gem Version Build Status

What's a correctly formatted CHANGELOG file?

By design, danger-changelog is quite strict with what it allows as a valid changelog file, using the Intridea style, used by this library itself. It also supports the Keep a Changelog format.

Installation

Add danger-changelog to your Gemfile.

gem 'danger-changelog', '~> 0.6.0'

Call changelog.check! from your Dangerfile. Make a pull request and see this plugin in action.

Usage

Methods and attributes from this plugin are available in your Dangerfile under the changelog namespace.

Configuration

The following options and checks are supported.

changelog.filename

Set the CHANGELOG file name, defaults to CHANGELOG.md.

changelog.filename = 'CHANGES.md'

changelog.format

Set the format of the CHANGELOG file.

changelog.format = :keep_a_changelog

Available formats are Intridea (default) and Keep a Changelog.

changelog.placeholder_line

Customize the * Your contribution here. line. Set the value to nil to stop checking for one.

changelog.placeholder_line = "* Your change here.\n"

changelog.ignore_files

Ignore additions and changes with a certain name or expression, default is to ignore README.md changes.

For example, ignore UPGRADING.md and all .txt files.

changelog.ignore_files = ['README.md', 'UPGRADING.md', /\.txt$/]

Checks

Invoke check methods.

changelog.check!

Run all checks with defaults, including have_you_updated_changelog? and is_changelog_format_correct?.

changelog.have_you_updated_changelog?

Checks whether you have updated CHANGELOG.md.

changelog.is_changelog_format_correct?

Checks whether the CHANGELOG format is correct.

Contributing

See CONTRIBUTING.

Copyright (c) Daniel Doubrovkine, 2016

MIT License, see LICENSE for details.