@@ -11,13 +11,16 @@ commitlint checks if your commit messages meets the [conventional commit format]
1111 - [ Using go] ( #using-go )
1212- [ Enable in Git Repo] ( #enable-in-git-repo )
1313- [ Quick Test] ( #quick-test )
14- - [ Custom config for each repo] ( #custom-config-for-each-repo )
15- - [ Benefits of using commitlint] ( #benefits-of-using-commitlint )
16- - [ Commit Types] ( #commit-types )
14+ - [ Benefits of using conventional commit] ( #benefits-of-using-conventional-commit )
15+ - [ Commit Types] ( #commit-types )
16+ - [ Commands] ( #commands )
17+ * [ Custom config for each repo] ( #custom-config-for-each-repo )
18+ * [ Verify config file] ( #verify-config-file )
19+ - [ Rules] ( #rules )
1720- [ Library] ( #library )
1821 - [ Config Precedence] ( #config-precedence )
19- - [ Message Precedence] ( #message-precedence )
20- - [ Default Config] ( #default-config )
22+ - [ Commit Message Precedence] ( #commit- message-precedence )
23+ - [ Default Config] ( #default-config )
2124- [ License] ( #license )
2225
2326### Installation
@@ -58,19 +61,20 @@ echo "feat: good commit message" | commitlint lint
5861# ✔ commit message
5962```
6063
61- ### Custom config for each repo
64+ ### Benefits of using conventional commit
6265
63- - run ` commitlint create config ` in repo root directory
64-
65- this will create ` commitlint.yaml ` in that directory, you can customise the config to your need
66+ - Conventional Commit format. Read [ Full Specification here ] ( https://www.conventionalcommits.org/en/v1.0.0/#specification )
67+ ```
68+ <type>[optional scope]: <description>
6669
67- - run ` commitlint verify ` to verify if config is valid or not
70+ [optional body]
6871
69- ### Benefits of using commitlint
72+ [optional footer(s)]
73+ ```
7074
7175- [ Why Use Conventional Commits] ( https://www.conventionalcommits.org/en/v1.0.0/#why-use-conventional-commits )
7276
73- ### Commit Types
77+ #### Commit Types
7478
7579Commonly used commit types from [ Conventional Commit Types] ( https://github.com/commitizen/conventional-commit-types )
7680
@@ -89,6 +93,45 @@ Commonly used commit types from [Conventional Commit Types](https://github.com/c
8993| revert | Reverts a previous commit |
9094| merge | Merges a branch |
9195
96+ ### Commands
97+
98+ ##### Custom config for each repo
99+
100+ - run ` commitlint create config ` in repo root directory
101+
102+ this will create ` commitlint.yaml ` in that directory, you can customise the config to your need
103+
104+ ##### Verify config file
105+
106+ - run ` commitlint verify ` to verify if config is valid or not (according to config precedence)
107+
108+ - run ` commitlint verify --config=/path/to/conf.yaml ` to verify given config file
109+
110+ ### Rules
111+
112+ The list of available lint rules
113+
114+ | name | argument | flags | description |
115+ | ---------------------- | -------- | ----------------- | -------------------------------------------- |
116+ | header-min-length | int | n/a | checks the min length of header (first line) |
117+ | header-max-length | int | n/a | checks the max length of header (first line) |
118+ | body-max-line-length | int | n/a | checks the max length of each line in body |
119+ | footer-max-line-length | int | n/a | checks the max length of each line in footer |
120+ | type-enum | [ ] string | n/a | restrict type to given list of string |
121+ | scope-enum | [ ] string | allow-empty: bool | restrict scope to given list of string |
122+ | type-min-length | int | n/a | checks the min length of type |
123+ | type-max-length | int | n/a | checks the max length of type |
124+ | scope-min-length | int | n/a | checks the min length of scope |
125+ | scope-max-length | int | n/a | checks the max length of scope |
126+ | description-min-length | int | n/a | checks the min length of description |
127+ | description-max-length | int | n/a | checks the max length of description |
128+ | body-min-length | int | n/a | checks the min length of body |
129+ | body-max-length | int | n/a | checks the max length of body |
130+ | footer-min-length | int | n/a | checks the min length of footer |
131+ | footer-max-length | int | n/a | checks the max length of footer |
132+ | type-charset | string | n/a | restricts type to given charset |
133+ | scope-charset | string | n/a | restricts scope to given charset |
134+
92135### Library
93136
94137#### Config Precedence
@@ -97,13 +140,13 @@ Commonly used commit types from [Conventional Commit Types](https://github.com/c
97140- config file passed with ` --config ` command-line argument
98141- [ default config] ( #default-config )
99142
100- #### Message Precedence
143+ #### Commit Message Precedence
101144
102- - ` stdin ` stream
145+ - ` stdin ` pipe stream
103146- commit message file passed with ` --message ` command-line argument
104147- ` .git/COMMIT_EDITMSG ` in current directory
105148
106- #### Default Config
149+ ### Default Config
107150
108151``` yaml
109152formatter : default
0 commit comments