New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

danger-plugin-commit-lint

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danger-plugin-commit-lint

This is a Danger Plugin that ensures nice and tidy commit messages.

latest
Source
npmnpm
Version
1.2.0
Version published
Weekly downloads
332
19.86%
Maintainers
1
Weekly downloads
 
Created
Source

Commit Lint for Danger.js

CircleCI

This is a Danger Plugin that ensures nice and tidy commit messages. The checks performed on each commit message are inspired by Tim Pope's blog post on good commit messages, echoed by git's own documentation on the subject. This is almost a direct typescript port of the ruby version, which you can find here. Thanks to @jonallured for creating the ruby version.

Installation

yarn add danger-plugin-commit-lint -D

Usage

Simply add this to your Dangerfile:

import * as commitLint from 'danger-plugin-commit-lint'

commitLint.check()

That will check each commit in the PR to ensure the following is true:

  • Commit subject begins with a capital letter (subject_cap)
  • Commit subject is more than one word (subject_words)
  • Commit subject is no longer than 50 characters (subject_length)
  • Commit subject does not end in a period (subject_period)
  • Commit subject and body are separated by an empty line (empty_line)

By default, Commit Lint fails, but you can configure this behavior.

Configuration

Configuring Commit Lint is done by passing a hash. The three keys that can be passed are:

  • disable
  • fail
  • warn

To each of these keys you can pass true or an array of checks. Here are some ways you could configure Commit Lint:

// warn on all checks (instead of failing)
commitLint.check({ warn: true })

// disable the `subject_period` check
commitLint.check({ disable: ["subject_period"] })

Remember, by default all checks are run and they will fail. Think of this as the default:

commitLint.check({ fail: true })

Also note that there is one more way that Commit Lint can behave:

commitLint.check({ disable: true })

This will actually throw a warning that Commit Lint isn't doing anything.

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

Keywords

danger

FAQs

Package last updated on 22 Oct 2019

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