Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commitplease

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commitplease

Validates strings as commit messages

  • 1.10.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.2K
decreased by-2.56%
Maintainers
1
Weekly downloads
 
Created
Source

Commitplease

Build Status

This node.js module validates git commit messages while you commit, according to the rules specified in the jQuery Commit Guidlines. These are pretty generic, so this module should be useful for most projects that care about commit message formats.

Installation

npm install commitplease

A git version of 1.8.5 or newer is recommended. If you use git commit --verbose, it is required.

Usage

Just commit as usual. This modules installs a git commit-msg hook, automatically validating all commit messages as you enter them. Invalid messages will be rejected, with details on what's wrong and a copy of the input.

API

The API is a work-in-progress

var validate = require('commitplease/lib/validate');
var errors = validate(commit.message);
if (errors.length) {
	postComment('This commit has ' + errors.length + ' problems!');
}

validate(message[, options]), returns Array

  • message (String): The commit message to validate. Must use LF (\n) as line breaks.
  • options (Object, optional): Use this to override the default settings, see properties and defaults below
  • returns Array: Empty for valid messages, one or more items as String for each problem found

Options and their defaults:

component: true,
limits: {
	subject: 72,
	other: 80
}

Customizing the bundled options

The validation options can be overriden by configuring the commitplease property on your own project's package.json. This allows you to customize some of the validation rules available.

Here's an example for disabling the component message validation:

{
  "name": "Example",
  "description": "An example project with custom commit hook options",
  "devDependencies": {
    "commitplease": "1.10.x"
  },
  "commitplease": {
    "component": false
  }
}

License

Copyright 2014 Jörn Zaefferer. Released under the terms of the MIT license.


Support this project by donating on Gittip.

Keywords

FAQs

Package last updated on 28 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc