Skip to content

Commit 73bce6a

Browse files
neoandmatrixasyncapi-botShurtu-gal
authored
chore: pre commit hooks added for checks. (#1819)
Co-authored-by: Tushar Anand <[email protected]> Co-authored-by: asyncapi-bot <[email protected]> Co-authored-by: Ashish Padhy <[email protected]>
1 parent 5aec47d commit 73bce6a

File tree

5 files changed

+962
-18
lines changed

5 files changed

+962
-18
lines changed

DEVELOPMENT.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@ After cloning the repository, you should setup the fork properly and configure t
2121
npm install
2222
```
2323

24+
3. **Set up Git hooks with Lefthook:**
25+
26+
Lefthook is used to run tests and commit message checks automatically on each and every commit.
27+
After installing dependencies, Lefthook hooks are set up automatically.
28+
If you ever need to re-install hooks, run:
29+
30+
```bash
31+
npx lefthook install
32+
```
33+
> [!TIP]
34+
> If during commiting changes lefthooks fail at test stage please try running commiting again once.
35+
36+
## Pre-commit and commit message hooks
37+
38+
This project uses [Lefthook](https://github.com/evilmartians/lefthook) to enforce code quality and commit standards:
39+
40+
2441
## Running tests
2542

2643
### Local testing

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
};

lefthook.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
pre-commit:
2+
parallel: true
3+
commands:
4+
lint:
5+
run: npm run lint
6+
test:
7+
run: npm run test:unit
8+
9+
commit-msg:
10+
parallel: true
11+
commands:
12+
commitlint:
13+
run: npx commitlint --edit {1}
14+
echo-test:
15+
run: echo "Lefthook running"

0 commit comments

Comments
 (0)