Socket
Socket
Sign inDemoInstall

semantic-commitlint

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-commitlint

📦🚀 + 📓 A continuous integration build tool to ensure all new commits meet your commit message format! ️️


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

Semantic Commitlint npm version

📦🚀 + 📓 A continuous integration build tool to ensure all new commits meet your commit message format! ️️

Build Status Dependency Status devDependency Status

Features

Install

npm install semantic-commitlint --save-dev

Setup

Add the following to your package.json

{
  "scripts": {
    "semantic-commitlint": "semantic-commitlint",
    "semantic-release": "semantic-release"
  },
  "release": {
    "verifyRelease": [
      "semantic-commitlint"
    ]
  }
}

Setup semantic-release authentication for CI

Usage

Add the following commands to your CI build process

npm run semantic-commitlint -- --ci
npm run semantic-release

Local usage

To get early feedback on commit messages you can add the following to a commit hook or your regular set of tests.

npm run semantic-commitlint

This allows your project's contributors to get early feedback on their last commit message instead of waiting for CI to fail a build.

  • Last commit only - this will not validate all new commit messages because Github auth is required to gather commits that have been added since the last release.

Config

Skip commits

If there are unreleased commits that shouldn't fail a build, then add them to your package.json inside the semanticCommitlint config.

{
  "semanticCommitlint": {
    "skipCommits": ["a1be371"]
  }
}

Custom lint functions

To add a custom lint function add your function's path in package.json.

{
  "semanticCommitlint": {
    "lintFunctions": ["./my-function.js"]
  }
}

The function itself works like this:

// my-function.js
function customValidation(commitMessage, report) {
  if (commitMessage.includes('something bad')) {
    report.valid = false;
    report.errors.push({
      level: 2,
      valid: false,
      name: 'type-bad',
      message: 'Commit message should have been better!'
    });
  }
}

module.exports = customValidation;

External config

This project just ties together some functionality from two external projects. For all other config options make sure to read through the docs.

Issues

Not all features implemented in semantic-release and commitlint are currently available when using semantic-commtlint. If you have a suggestion, please open an issue. Thanks!

License

frosted-glass is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.

FAQs

Package last updated on 31 Jan 2018

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