Skip to content

Commit f915f25

Browse files
lint(docs): apply markdownlint recommandations
1 parent 0460326 commit f915f25

File tree

1 file changed

+112
-72
lines changed

1 file changed

+112
-72
lines changed

Diff for: README.md

+112-72
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Commit message validator
2+
13
<!-- PROJECT SHIELDS -->
24

35
[![Contributors][contributors-shield]][contributors-url]
@@ -7,6 +9,7 @@
79
[![MIT License][license-shield]][license-url]
810

911
<!-- PROJECT LOGO -->
12+
<!-- markdownlint-disable no-inline-html -->
1013
<br />
1114
<p align="center">
1215
<a href="https://github.com/lumapps/commit-message-validator">
@@ -16,16 +19,24 @@
1619
<h3 align="center">Commit message validator</h3>
1720

1821
<p align="center">
19-
Enforce angular commit message convention with minimal dependancy only git and bash.
22+
Enforce angular commit message convention with minimal dependancy only
23+
git and bash.
2024
<br />
21-
<a href="https://github.com/lumapps/commit-message-validator"><strong>Explore the docs »</strong></a>
25+
<a href="https://github.com/lumapps/commit-message-validator">
26+
<strong>Explore the docs »
27+
</strong></a>
2228
<br />
2329
<br />
24-
<a href="https://github.com/lumapps/commit-message-validator/issues">Report Bug</a>
30+
<a href="https://github.com/lumapps/commit-message-validator/issues">
31+
Report Bug
32+
</a>
2533
·
26-
<a href="https://github.com/lumapps/commit-message-validator/issues">Request Feature</a>
34+
<a href="https://github.com/lumapps/commit-message-validator/issues">
35+
Request Feature
36+
</a>
2737
</p>
2838
</p>
39+
<!-- markdownlint-enable no-inline-html -->
2940

3041
<!-- TABLE OF CONTENTS -->
3142

@@ -47,27 +58,32 @@
4758

4859
## About The Project
4960

50-
The provided script enforce Angular commit message convention, with an opinionated reduction of allowed types.
51-
Moreover, it enforces reference to a project management tools named JIRA.
61+
The provided script enforce Angular commit message convention, with an
62+
opinionated reduction of allowed types. Moreover, it enforces reference to a
63+
project management tools named JIRA.
5264

5365
### Commit Message Format
5466

5567
Each commit message consists of a **header**, a **body** and a **footer**.
56-
The header has a special format that includes a **type**, a **scope** and a **subject**:
68+
The header has a special format that includes a **type**, a **scope** andi
69+
a **subject**:
5770

58-
```
71+
```Markdown
5972
<type>(<scope>): <subject>
6073
<BLANK LINE>
6174
<body>
6275
<BLANK LINE>
6376
<footer>
6477
```
6578

66-
- The first line of the commit message (the "Subject") cannot be longer than 70 characters.
79+
- The first line of the commit message (the "Subject") cannot be longer than 70
80+
characters.
6781
- Any other line of the commit message cannot be longer 100 characters!
68-
- The body and footer are optional, but depends on the type some information can be mandatory.
82+
- The body and footer are optional, but depends on the type, information can be
83+
mandatory.
6984

70-
This allows the message to be easier to read on github as well as in various git tools.
85+
This allows the message to be easier to read on github as well as in various
86+
git tools.
7187

7288
### Type
7389

@@ -76,43 +92,49 @@ Must be one of the following:
7692
- **feat**: A new feature
7793
- **fix**: A bug fix
7894
- **docs**: Documentation only changes
79-
- **lint**: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc)
95+
- **lint**: Changes that do not affect the meaning of the code (white-space,
96+
formatting, missing semicolons, etc)
8097
- **refactor**: A code change that neither fixes a bug or adds a feature
8198
- **test**: Adding missing tests or correcting existing tests
82-
- **chore**: Changes to the build process or auxiliary tools and libraries such as distribution generation
99+
- **chore**: Changes to the build process or auxiliary tools and libraries such
100+
as distribution generation
83101

84102
### Scope
85103

86-
The scope could be anything specifying place of the commit change. For example `notification', 'dropdown', etc.
87-
The scope must be written in [kebab-case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
104+
The scope could be anything specifying place of the commit change. For example
105+
`notification', 'dropdown', etc.
106+
The scope must be written in
107+
[kebab-case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
88108

89109
### Subject
90110

91111
A brief but meaningfull description of the change.
92-
Here are some recommandation for writing your subject:
112+
Here are recommandations for writing your subject:
93113

94114
- use the imperative, present tense: "change" not "changed" nor "changes"
95115
- don't capitalize first letter
96116
- no "." (dot) at the end
97117

98118
### Body
99119

100-
The body should include the motivation for the change and contrast this with previous behavior.
120+
The body should include the motivation for the change and contrast this
121+
with previous behavior.
101122
It is optional but highly recommended for any impacting changes.
102123

103124
### Footer
104125

105-
The footer should contain any information about **Breaking Changes** and is also the place to
106-
reference JIRA ticket related to this commit.
126+
The footer should contain any information about **Breaking Changes** and is
127+
also the place to reference JIRA ticket related to this commit.
107128

108-
The footer is optional but for **feat** and **fix** type the JIRA reference is mandatory.
129+
The footer is optional but for **feat** and **fix** type the JIRA reference
130+
is mandatory.
109131

110-
The breaking changes must be at the end of the commit with only "BROKEN:" before the list of breaking changes.
111-
They must be each on a new line.
132+
The breaking changes must be at the end of the commit with only "BROKEN:"
133+
before the list of breaking changes. They must be each on a new line.
112134

113135
### Commit Example
114136

115-
```
137+
```Markdown
116138
feat(toto-service): provide toto for all
117139

118140
Before we had to do another thing. There was this and this problem.
@@ -128,23 +150,24 @@ second thing broken
128150

129151
The proper for revert based on Angular commit message convention should be:
130152

131-
```
153+
```Markdown
132154
revert: feat(toto-service): provide toto for all
133155

134156
This reverts commit <sha1>.
135157
```
136158

137159
However, the default git behavior, that cannot be easily overiden is:
138160

139-
```
161+
```Markdown
140162
Revert "feat(toto-service): provide toto for all"
141163

142164
This reverts commit <sha1>.
143165
```
144166

145167
Thus we won't enforce one or the other, we will only enfore:
146-
* starting the commit title with revert (with a capitalized letter or not)
147-
* having the sentence "This reverts commit <sha1>"
168+
169+
- starting the commit title with revert (with a capitalized letter or not)
170+
- having the sentence "This reverts commit \<sha1\>"
148171

149172
### Built With
150173

@@ -153,39 +176,39 @@ Thus we won't enforce one or the other, we will only enfore:
153176

154177
<!-- GETTING STARTED -->
155178

156-
## Getting Started with command line
179+
## Getting started with command line
157180

158-
To get a local copy up and running follow these simple steps.
181+
To get a local copy up and running follow these steps.
159182

160183
### Prerequisites
161184

162185
1. Install bash
163186

164-
```sh
165-
sudo apt install bash
166-
```
187+
```sh
188+
sudo apt install bash
189+
```
167190

168191
2. Install bats for development testing
169192

170-
```sh
171-
sudo apt install bats
172-
```
193+
```sh
194+
sudo apt install bats
195+
```
173196

174197
### Installation
175198

176199
1. Clone the commit-message-validator
177200

178-
```sh
179-
git clone https://github.com/lumapps/commit-message-validator.git
180-
```
201+
```sh
202+
git clone https://github.com/lumapps/commit-message-validator.git
203+
```
181204

182205
That's all, your ready to go !
183206

184207
<!-- USAGE EXAMPLES -->
185208

186209
## Usage
187210

188-
Check the commit message referenced by <commit1>:
211+
Check the commit message referenced by \<commit1\>:
189212

190213
```sh
191214
./check.sh <commit1>
@@ -197,85 +220,98 @@ Check all the commits between 2 references:
197220
./check.sh <commit1>..<commit2>
198221
```
199222

200-
Behind the hood, the script use `git log` to list all the commit thus any syntax allowed by git will be working.
223+
Behind the hood, the script use `git log` to list all the commit thus any
224+
syntax allowed by git will be working.
201225

202-
You can also use the pre-push commit validator, simply copy, `pre-push`, `validator.sh` and `check.sh` files
226+
You can also use the pre-push commit validator, simply copy, `pre-push`,
227+
`validator.sh` and `check.sh` files
203228
in `.git/hooks` directory of your repository.
204229

205-
### OPTIONS
230+
### Command line Options
206231

207-
- if `COMMIT_VALIDATOR_NO_JIRA` environment variable is not empty, no validation is done on JIRA refs.
208-
- if `COMMIT_VALIDATOR_ALLOW_TEMP` environment variable is not empty, no validation is done on `fixup!` and `squash!` commits.
232+
- if `COMMIT_VALIDATOR_NO_JIRA` environment variable is not empty,
233+
no validation is done on JIRA refs.
234+
- if `COMMIT_VALIDATOR_ALLOW_TEMP` environment variable is not empty,
235+
no validation is done on `fixup!` and `squash!` commits.
209236

210237
### Commit template
211238

212-
You might want to use the predefined commit template in order to keep the main information under hand.
239+
You want to use the predefined commit template to keep the main information
240+
under hand.
241+
242+
For that, you have to add the following lines in your repository's gitconfig
243+
(located at `<project_root>/.gitconfig`).
213244

214-
For that, you have to add the following lines in your repository's gitconfig (located at `<project_root>/.gitconfig`).
215245
```conf
216246
[commit]
217247
template = /path/to/git-commit-template
218248
```
219249

220-
## Getting Started with github action
250+
## Getting started with github action
221251

222-
To enable the action simply create the .github/workflows/commit-message-validator.yml file with the following content:
252+
To enable the action simply create the
253+
.github/workflows/commit-message-validator.yml file with the following content:
223254

224255
```yml
225-
name: 'Commit message validation on pull request'
256+
name: "Commit message validation on pull request"
226257

227-
on:
228-
pull_request
258+
on: pull_request
229259

230260
jobs:
231261
commit-message-validation:
232-
233262
runs-on: ubuntu-latest
234263

235264
steps:
236-
- name: Checkout
237-
uses: actions/checkout@v2
265+
- name: Checkout
266+
uses: actions/checkout@v2
238267

239-
- name: Commit message validation
240-
uses: lumapps/commit-message-validator@master
241-
env:
242-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
268+
- name: Commit message validation
269+
uses: lumapps/commit-message-validator@master
270+
env:
271+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
243272
```
244273
245-
### OPTIONS
274+
### Github Action option
246275
247276
- if `no_jira` is not empty, no validation is done on JIRA refs.
248-
- if `allow_temp` is not empty, no validation is done on `fixup!` and `squash!` commits.
277+
- if `allow_temp` is not empty, no validation is done on `fixup!`
278+
and `squash!` commits.
249279

250280
## Add pre-commit plugin
251281

252-
If you are using [pre-commit](https://pre-commit.com/) in you repository, you can add this to your configuration so commit messages are checked locally:
282+
If you are using [pre-commit](https://pre-commit.com/) in you repository,
283+
you can add this to your configuration so commit messages are checked locally:
253284

254285
Into `.pre-commit-config.yaml`:
286+
255287
```yaml
256-
...
288+
289+
---
257290
repos:
258-
...
291+
---
259292
- repo: https://github.com/lumapps/commit-message-validator
260293
rev: master
261294
hooks:
262295
- id: commit-message-validator
263296
stages: [commit-msg]
264297
args: [--allow-temp]
265-
...
266298
```
267-
Then run `pre-commit install --hook-type commit-msg` to install the `commit-message-validator`
268299

269-
### OPTIONS
300+
Then run `pre-commit install --hook-type commit-msg` to install the
301+
`commit-message-validator`
302+
303+
### Pre commit hook options
270304

271305
- if `no_jira` is set, no validation is done on JIRA refs.
272-
- if `allow_temp` is set, no validation is done on `fixup!` and `squash!` commits.
306+
- if `allow_temp` is set, no validation is done on `fixup!` and `squash!`
307+
commits.
273308

274309
<!-- ROADMAP -->
275310

276311
## Roadmap
277312

278-
See the [open issues](https://github.com/lumapps/commit-message-validator/issues) for a list of proposed features (and known issues).
313+
See the [open issues](https://github.com/lumapps/commit-message-validator/issues)
314+
for a list of proposed features (and known issues).
279315

280316
- [x] list all the commit, and run validation on each
281317
- [x] enforce the overall commit message structure
@@ -297,14 +333,15 @@ See the [open issues](https://github.com/lumapps/commit-message-validator/issues
297333

298334
## Contributing
299335

300-
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
336+
Contributions are what make the open source community such an amazing place to be
337+
learn, inspire, and create. Any contributions you make are **greatly appreciated**.
301338

302339
1. Fork the Project
303340
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
304341
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
305342
4. Run the tests (`bats -j 100 validator.bats`)
306-
4. Push to the Branch (`git push origin feature/AmazingFeature`)
307-
5. Open a Pull Request
343+
5. Push to the Branch (`git push origin feature/AmazingFeature`)
344+
6. Open a pull request
308345

309346
<!-- LICENSE -->
310347

@@ -322,7 +359,10 @@ Project Link: [https://github.com/lumapps/commit-message-validator](https://gith
322359

323360
## Acknowledgements
324361

325-
Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
362+
<!-- markdownlint-disable no-inline-html -->
363+
Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a>
364+
from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
365+
<!-- markdownlint-enable no-inline-html -->
326366

327367
<!-- MARKDOWN LINKS & IMAGES -->
328368
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

0 commit comments

Comments
 (0)