Skip to content
This repository has been archived by the owner on Nov 13, 2020. It is now read-only.
/ komet Public archive

Write intelligible commit messages, by answering questions

License

Notifications You must be signed in to change notification settings

kometjs/komet

Repository files navigation

komet NPM version

Write intelligible commit messages, by answering questions

Circle ci Status Dependency ci Status Dependency Status

Deprecated

Use @commitlint/prompt-cli instead.

Demo

demo

Install

npm install --save-dev komet komet-karma

Configuration

You have a file .commitrc.js at the root of your project.

This file contains an array of plugins:

module.exports = [
  'karma',
]

How to use

create .git/hooks/prepare-commit-msg

#!/bin/sh

# Allow to read user input, assigns stdin to keyboard
exec < /dev/tty

case "$2," in
  message,|template,|,)
    node_modules/.bin/prepare-commit-msg --path "$1"
    ;;
  *) ;;
esac

Direct use (requires global install)

commit

All args are passed to git commit.

With npm scripts npm run commit

Edit your package.json:

{
    "scripts": {
        "commit": "commit",
    }
}

Plugin

questions are the questions which are going to be asked to create your commit message (it uses Inquirer)

processAnswers is a function which build and return the commit message.

You can check how works karma plugin here

Related