0.1.2 • Published 5 years ago

commitlint-plugin-cleanfeet v0.1.2

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

CleanFeet

Introduction

CleanFeet is a plugin extension for commitlint, which is a tool for linting commit messages.

If you want to learn more about structured and convention-driven commit messages, see conventional commits

Rules

This plugin adds 2 rules:

  • footer-format:
    • This rule determines the format a single footer line has to adhere to by allowing you to specify a set of regular expressions.
    • The rule passes in case there is no footer.
  • footer-max-occurrence-breaking-change:
    • This rule allows you to specify how many occurrences the footer can contain of BREAKING CHANGE: <description>. You're allowed to pass in your own regex [2, 'always', { max: 1, regex: /^BREAKING CHANGE: .*$/ }]
    • The rule passes in case there is no footer.
    • Specifying never has no effect.

Sample configuration

module.exports = {
	extends: ['@commitlint/config-conventional'],
	plugins: ['cleanfeet'],
	rules: {
		'footer-format': [
			2, 
			'always', 
			[
				'^BREAKING CHANGE: .*',
				'^[a-zA-Z0-9-]+: .*',
				'^[a-zA-Z0-9-]+ #.*'
			]
		],
		'footer-max-occurrence-breaking-change': [2, 'always', { max: 1, regex: /^BREAKING CHANGE: .*$/ }]
	}
};

Todo

  • Show which regular expression has been matched in case of specifying never for footer-format