Skip to content

Commit

Permalink
feat(scripts): add help url to commitlint script
Browse files Browse the repository at this point in the history
  • Loading branch information
sbsrnt committed Feb 25, 2024
1 parent f6d47c4 commit 3377be2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .lefthook/commit-msg/commitlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
source ./node_modules/@exile-watch/lefthook-config/scripts/commitlint.sh

run_commitlint
10 changes: 9 additions & 1 deletion packages/lefthook-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ module.exports = {
};
```

3. Create `lefthook.yml` in repo root:
3. In project root create `lefthook.yml`:
```yaml
remotes:
- git_url: https://github.com/exile-watch/splinters
configs:
- packages/lefthook-config/lefthook.yml
```
4. In project root create `.lefthook/commit-msg/commitlint.sh` file:
```bash
#!/bin/bash
source ./node_modules/@exile-watch/lefthook-config/scripts/commitlint.sh
run_commitlint
```
5 changes: 4 additions & 1 deletion packages/lefthook-config/scripts/commitlint.sh
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
echo $(head -n1 $1) | npx commitlint --color
#!/bin/bash
function run_commitlint {
echo $(head -n1 $1) | npx commitlint --edit --color --help-url='https://docs.exile.watch/development/commit-message-guidelines'
}

0 comments on commit 3377be2

Please sign in to comment.