SEE DISCLAIMER. Chapter is an open-source, C++ tool that provides conventions for Git commit messages. After every git commit
, an audit script will display warnings and errors in your terminal regarding your commit message. Choose your message preferences through a set of custom rules defined in a .json
file. Adding this tool to your project can help ensure that commit messages become standardized and informative.
- Clone repository, compile, and move files into your
$HOME/
directory:
$ git clone https://williamgrosset/chapter.git && cd chapter/
$ make fresh
$ mv chapter.o en.bin $HOME/
- Update the
post-commit
hook in your project directory (project/.git/hooks/post-commit
):
#!/bin/bash
$HOME/chapter.o
- Create the
COMMIT_MSG_RULES.json
file in your project directory. See Rules below.
Show the world that you use Chapter:
[![commit style: chapter](https://img.shields.io/badge/commit%20style-chapter-red.svg)](https://github.com/williamgrosset/chapter)
Rules are defined in the COMMIT_MSG_RULES.json
file that will be in your project's top-level directory. Rules determine the structure and behaviour of commit messages. Rules can be turned-off and have their values modified to preference. The entire list of rules defined in the JSON file can be seen below:
{
"sum_max_len": 50,
"sum_min_len": 18,
"desc": {
"max_len": 110,
"min_len": 40
},
"bullet_points": {
"count": 3,
"max_len": 70,
"min_len": 24
},
"sum_capital": true,
"identify_typos": true,
"doc_format": true,
"nit_format": true,
"wip_format": true
}
Identify typos via a trained neural net from JamSpell. Rule must be a boolean:
"identify_typos": true
Require summary to be capitalized. Rule must be a boolean:
"sum_capital": true
Define maximum and minimum length of summary. Both rules are required and must be a positive integer:
"sum_max_len": 50,
"sum_min_len": 18
Require formatting for messages related to documentation. Rule must be a boolean:
"doc_format": true
Docs: Insert summary text here
Require formatting for messages related to nits. Rule must be a boolean:
"nit_format": true
Nit: Insert summary text here
Require formatting for messages related to work in progress. Rule must be a boolean:
"wip_format": true
WIP: Insert summary text here
Define maximum and minimum length of description. Rule must not exist (description not required) or be an object with max_length
and min_length
, both as positive integers:
"desc": {
"max_len": 72,
"min_len": 40
}
Insert summary text here
Insert description here regarding more details about the commit changes.
Identifying typos works best when there are full sentences.
Define count, maximum and minimum length of bullet points. Rule must not exist (bullet points not required) or be an object with count
, max_length
, and min_length
, all as positive integers:
"bullet_points": {
"count": 3,
"max_len": 80,
"min_len": 12
}
Bullet points are on their own line starting with one of the characters: +
, *
, -
.
Insert summary text here
Insert description here regarding more details about the commit changes.
Identifying typos works best when there are full sentences.
+ Key points regarding feature.
+ Shorter than summary.
+ Any other details.
See ARTICLES.md.
See TODO.md.
See CONTRIBUTING.md.
Chapter was integrated into this repository at commit message #XXX.
Chapter is in early stages of development (writing tests) β use with caution.