Skip to content

Commit eca54ec

Browse files
committed
doc: fix markdownlint issues
The documentation also highlights more what is the expected URL format Signed-off-by: Alex Fabre <[email protected]>
1 parent 806bbfa commit eca54ec

File tree

1 file changed

+40
-27
lines changed

1 file changed

+40
-27
lines changed

README.md

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# commit-format
2+
23
A 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

1920
Help 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

2930
You can check that every line in the commit message (including the title/header)
3031
does 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.
3435
Usage:
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

5567
Usage:
5668

5769
```sh
58-
$ commit-format -t /path/to/.commit-format
70+
commit-format -t /path/to/.commit-format
5971
```
6072

6173
Template 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
102114
Running on branch main. Abort checking commits.
103115
```
104116

@@ -110,25 +122,26 @@ to run regadless the branch name.
110122
Usage:
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

118130
You 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
126139
Usage:
127140

128141
```sh
129-
$ commit-format -b origin/main
142+
commit-format -b origin/main
130143
```
131144

132-
### -v (--verbosity)
145+
### `-v`, `--verbosity`
133146

134147
Display debug messages from the script.

0 commit comments

Comments
 (0)