1.0.2 • Published 3 years ago

@faciliter/commit-msg-validator v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Commit Message Validator

A tool for validate commit message.

usage

This tool dependencies on yorkie.

So we can add follow code in package.json:

{
    "gitHooks": {
        "commit-msg": "cmv"
    }
}

Rules

Every commit message must match the following RegExp:

const regexp = /^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|release|merge)(\(.+\))?: .{1,50}/;

Types

typedescription
featnew feature
fixfix bug
docsdocumentation
stylestyles
refactorrefactor
testadd or change test
choredaily change
perfimporove performance
workflowworkflow change
buildbuild
cicontinuous integration
mergecode merge
typestypescript declaration
releaseversion update

Example

We can use following format with commit message:

`type(socpe): commit message`

There are some examples:

//feature
feat(package): add a new function.

//daily change
chore(root): update package.json.