Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including poppins-check-commit with all npm packages installed. Try it out:

var poppinsCheckCommit = require("poppins-check-commit")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

poppins-check-commit v0.2.0

mary-poppins plugin for checking commit message format

poppins-check-commit

A Mary Poppins plugin for checking commit message format. It was designed to enforce this commit message format, but it can be used with other conventions as well. Requires the pr-checklist plugin.

Install

npm install poppins-check-commit

Configure

To use this plugin, you need to load it in your config file with couldYouPlease:

// config.js
module.exports = function (poppins) {

  poppins.config = { /*...*/ };

  // pr checklist config
  poppins.couldYouPlease('pr-checklist');
  poppins.plugins.prChecklist.greeting = 'Hello';
  poppins.plugins.prChecklist.closing = 'Farewell';

  // check commit config
  poppins.couldYouPlease('check-commit');
};

Options

Options are available on popins.plugins.checkCommit. They should be fairly self-explanatory if you read the plugin's source.

popins.plugins.checkCommit.message

String. Defaults to "PR's commit messages follow the [commit message format](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#)"

popins.plugins.checkCommit.condition

Function. Returns promise that resolves to a bool as to whether or not the PR follows the guidelines.

popins.plugins.checkCommit.check

Function. Run on each commit to determine its validity.

License

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free