11# commit-format
2+
23A tool to check your commit messages format.
34
45## Supported checkers
@@ -13,18 +14,18 @@ Primarily disigned for to check for spelling mistakes in commit messages,
1314## Installation
1415
1516``` sh
16- $ pip install commit-format
17+ pip install commit-format
1718```
1819
1920Help command will show you all availables options:
2021
2122``` sh
22- $ commit-format --help
23+ commit-format --help
2324```
2425
2526## Format options
2627
27- ### -l ( --limit INT) Line limit check
28+ ### ` -l ` , ` --limit ` Line limit check
2829
2930You can check that every line in the commit message (including the title/header)
3031does not exceed a length limit. By default the value is set to ` 72 ` .
@@ -34,28 +35,39 @@ A limit of '0' `--limit 0` will disable the line limit checker.
3435Usage:
3536
3637``` sh
37- $ commit-format -l 80
38+ commit-format -l 80
3839```
3940
40- ### -ns (--no-spelling) Disable spelling mistake
41+ > URL in the commit body will not trigger any length warnings if it
42+ > adheres to the expected format.
43+ >
44+ > ``` txt
45+ > my commit message has a ref[1]
46+ > ...
47+ >
48+ > [1] url://...
49+ > ```
50+
51+ ### `-ns`, `--no-spelling` Disable spelling mistake
4152
42- By default, ` commit-format ` checks for common spelling mistakes in the commit messages.
43- This option rely on ` codespell ` and may produce some false-positive results.
44- This new option ` -ns ` ` --no-spelling ` let the user disable the spelling checker.
53+ By default, `commit-format` checks for common spelling mistakes in the commit
54+ messages. This option rely on `codespell` and may produce some false-positive
55+ results. This new option `-ns` `--no-spelling` let the user disable the
56+ spelling checker.
4557
4658```sh
47- $ commit-format -ns
59+ commit-format -ns
4860```
4961
50- ### -t ( --template FILE) Template compliance
62+ ### ` -t ` , ` --template ` Template compliance
5163
52- You can provide a configuration TOML file template to validate the commit header/footer format
53- and required symbols.
64+ You can provide a configuration TOML file template to validate the commit
65+ header/footer format and required symbols.
5466
5567Usage:
5668
5769``` sh
58- $ commit-format -t /path/to/.commit-format
70+ commit-format -t /path/to/.commit-format
5971```
6072
6173Template schema (TOML):
@@ -64,7 +76,8 @@ Template schema (TOML):
6476 - pattern: Regex that the first line (header) must match.
6577- [ body]
6678 - allow_empty: true/false to allow a commit with only a header (no body).
67- - blank_line_after_header: true/false to enforce a blank line between header and body.
79+ - blank_line_after_header: true/false to enforce a blank line between header
80+ and body.
6881- [ footer]
6982 - required: true/false to require a footer section.
7083 - pattern: Regex that each footer line must match.
@@ -92,13 +105,12 @@ pattern = ^(Signed-off-by: ).+$
92105
93106## Behavior option
94107
95- ### -a ( --all) Force checking all commits
108+ ### ` -a ` , ` --all ` Force checking all commits
96109
97- By default the script will only run on a branch and stop when reaching the base branch.
98- If run on a base branch directly, the script will throw an error:
110+ By default the script will only run on a branch and stop when reaching the base
111+ branch. If run on a base branch directly, the script will throw an error:
99112
100113``` sh
101- $ commit-format
102114Running on branch main. Abort checking commits.
103115```
104116
@@ -110,25 +122,26 @@ to run regadless the branch name.
110122Usage:
111123
112124``` sh
113- $ commit-format -a
125+ commit-format -a
114126```
115127
116- ### -b ( --base) Base branch name
128+ ### ` -b ` , ` --base ` Base branch name
117129
118130You can set the base branch name according to your project.
119- As described in [ option -a section] ( #a---all-force-checking-all-commits ) the base branch name is required
120- to let the script restrict it's analysis on the commits of a branch.
121- Default value for the base branch name is ` main ` .
131+ As described in ` option -a ` section the base branch name is required to let the
132+ script restrict it's analysis on the commits of a branch. Default value for the
133+ base branch name is ` main ` .
122134
123- > When running this script in a CI environment, you may be required to fetch your base branch
124- > manually. See [ github workflow] ( .github/workflows/commit-format.yml ) example.
135+ > When running this script in a CI environment, you may be required to fetch your
136+ > base branch manually.
137+ > See [ github workflow] ( .github/workflows/commit-format.yml ) example.
125138
126139Usage:
127140
128141``` sh
129- $ commit-format -b origin/main
142+ commit-format -b origin/main
130143```
131144
132- ### -v ( --verbosity)
145+ ### ` -v ` , ` --verbosity `
133146
134147Display debug messages from the script.
0 commit comments