diff --git a/.lefthook/commit-msg/commitlint.sh b/.lefthook/commit-msg/commitlint.sh new file mode 100644 index 0000000..f06257f --- /dev/null +++ b/.lefthook/commit-msg/commitlint.sh @@ -0,0 +1,4 @@ +#!/bin/bash +source ./node_modules/@exile-watch/lefthook-config/scripts/commitlint.sh + +run_commitlint \ No newline at end of file diff --git a/packages/lefthook-config/README.md b/packages/lefthook-config/README.md index 23e83b3..f57ba39 100644 --- a/packages/lefthook-config/README.md +++ b/packages/lefthook-config/README.md @@ -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 ``` \ No newline at end of file diff --git a/packages/lefthook-config/scripts/commitlint.sh b/packages/lefthook-config/scripts/commitlint.sh index 04548bd..7d21a0b 100644 --- a/packages/lefthook-config/scripts/commitlint.sh +++ b/packages/lefthook-config/scripts/commitlint.sh @@ -1 +1,4 @@ -echo $(head -n1 $1) | npx commitlint --color \ No newline at end of file +#!/bin/bash +function run_commitlint { + echo $(head -n1 $1) | npx commitlint --edit --color --help-url='https://docs.exile.watch/development/commit-message-guidelines' +} \ No newline at end of file