Commity
Commity is a command line tool that will help you with commits conventions. You can configure Commity fast & easily so every collaborators can follow the commit convention you need.
Requirement
node >= 14.16.0
Installation
I highly recommand to use it globally.
npm i -g @pierred/commity
Get started
npm i -g @pierred/commitycommity initcommity
Usage
Commands:
| Command | Description |
|---|---|
commity |
Execute commity |
commity init |
Make your repo commity friendly creating a commity.json file |
Options:
| Option | Alias | Description |
|---|---|---|
--addAll |
-a |
Add all changes to the index (git add --all) before commit |
--push |
-p |
Push after commit |
Configuration
As You may see in commity.json, there are 2 parts you can configure: fields and render
{
"fields": [
{
"scope": {
"label": "Select the type of change that you're committing",
"type": "select",
"selectOptions": [
{
"value": "feat",
"description": "A new feature"
},
{
"value": "fix",
"description": "A bug fix"
},
{
"value": "docs",
"description": "Documentation only changes"
},
{
"value": "refactor",
"description": "Changes that neither fixes a bug or adds a feature"
}
]
}
},
{
"message": {
"label": "Choose the commit message"
}
},
{
"ticket": {
"label": "What is the issue id"
}
}
],
"render": "$+scope #$+ticket: $+message"
}Your fields take a field's key, in the above example there are two field's key : scope, message and ticket.
You can choose 2 types of field:
- simple input where you just need a
label - select input where you have to add
"type": "select"and provideselectOptions
render take the formatted string, replacing $+<commit field's key> with the user input.
More features incoming
