📦🚀 + 📓 A continuous integration build tool to ensure all new commits meet your commit message format! ️️
Problem
- 📦🚀 semantic-release depends on properly formatted commit messages
- 📓 commitlint is awesome, but it doesn't know which commits occurred since your last release
Solution
- semantic-commitlint fills the gap between semantic-release and commitlint by asking commitlint to lint new commit messages that have not been included in a previous release
Features
- Run in CI on all branches to ensure that only builds with valid commit messages pass
- Wraps semantic-release and commitlint for an easy install
- Minimal config
Install
npm install semantic-commitlint --save-dev
Setup
Add the following to your package.json
Setup semantic-release authentication for CI
Usage
Add the following commands to your CI build process
npm run semantic-commitlint -- --cinpm 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.
Custom lint functions
To add a custom lint function add your function's path in package.json
.
The function itself works like this:
// my-function.js { if commitMessage reportvalid = false; reporterrors; } moduleexports = 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.
Commit hooks
You can prevent invalid commit messages from every being created by using Git hooks!
- Add husky
npm install --save-dev husky@next
- Update
package.json
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
semantic-commitlint is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.