Skip to content

williamgrosset/chapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


old-english-fonts

Table of Contents

Demo

Chapter

Overview

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.

Usage

  1. 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/
  1. Update the post-commit hook in your project directory (project/.git/hooks/post-commit):
#!/bin/bash
$HOME/chapter.o
  1. Create the COMMIT_MSG_RULES.json file in your project directory. See Rules below.

Badge

Show the world that you use Chapter: commit style: chapter

[![commit style: chapter](https://img.shields.io/badge/commit%20style-chapter-red.svg)](https://github.com/williamgrosset/chapter)

Rules

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
}

Typos

Identify typos via a trained neural net from JamSpell. Rule must be a boolean:

"identify_typos": true

Summary Capitalization

Require summary to be capitalized. Rule must be a boolean:

"sum_capital": true

Summary Length

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

Documentation Format

Require formatting for messages related to documentation. Rule must be a boolean:

"doc_format": true

Format

Docs: Insert summary text here 

Nit Format

Require formatting for messages related to nits. Rule must be a boolean:

"nit_format": true

Format

Nit: Insert summary text here 

WIP Format

Require formatting for messages related to work in progress. Rule must be a boolean:

"wip_format": true

Format

WIP: Insert summary text here 

Description

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 
}

Format

Insert summary text here

Insert description here regarding more details about the commit changes.
Identifying typos works best when there are full sentences.

Bullet Points

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
}

Format

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.

Articles

See ARTICLES.md.

Future

See TODO.md.

Contributing

See CONTRIBUTING.md.

Internal Integration

Chapter was integrated into this repository at commit message #XXX.

Disclaimer

Chapter is in early stages of development (writing tests) β€” use with caution.

License

MIT