feat: introduce git hooks
Make installing git hooks easy using Husky. Also, updating the commit message checks. Includes setup instructions in the README. ref: N25B-366
This commit is contained in:
19
README.md
19
README.md
@@ -28,18 +28,21 @@ npm run dev
|
||||
|
||||
It should automatically reload when you save changes.
|
||||
|
||||
## GitHooks
|
||||
## Git Hooks
|
||||
|
||||
To activate automatic commits/branch name checks run:
|
||||
To activate automatic linting, branch name checks and commit message checks, run:
|
||||
|
||||
```shell
|
||||
git config --local core.hooksPath .githooks
|
||||
```bash
|
||||
npm run prepare
|
||||
```
|
||||
|
||||
If your commit fails its either:
|
||||
branch name != <type>/description-of-branch ,
|
||||
commit name != <type>: description of the commit.
|
||||
<ref>: N25B-Num's
|
||||
You might get an error along the lines of `Can't install pre-commit with core.hooksPath` set. To fix this, simply unset the hooksPath by running:
|
||||
|
||||
```bash
|
||||
git config --local --unset core.hooksPath
|
||||
```
|
||||
|
||||
Then run the pre-commit install commands again.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user