Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
semantic-commitlint
Advanced tools
📦🚀 + 📓 A continuous integration build tool to ensure all new commits meet your commit message format! ️️
📦🚀 + 📓 A continuous integration build tool to ensure all new commits meet your commit message format! ️️
npm install semantic-commitlint --save-dev
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
Add the following commands to your CI build process
npm run semantic-commitlint -- --ci
npm run semantic-release
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.
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"]
}
}
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;
This project just ties together some functionality from two external projects. For all other config options make sure to read through the docs.
You can prevent invalid commit messages from every being created by using Git hooks!
npm install --save-dev husky@next
package.json
{
"husky": {
"hooks": {
"prepare-commit-msg": "npm run semantic-commitlint -- -h"
}
}
}
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!
semantic-commitlint is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.
FAQs
📦🚀 + 📓 A continuous integration build tool to ensure all new commits meet your commit message format! ️️
The npm package semantic-commitlint receives a total of 3 weekly downloads. As such, semantic-commitlint popularity was classified as not popular.
We found that semantic-commitlint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.