From 3377be25d8bc3a6ecc8db941ca6b780b70511566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Krzy=C5=BCanowski?= Date: Sun, 25 Feb 2024 11:29:30 +0100 Subject: [PATCH] feat(scripts): add help url to commitlint script --- .lefthook/commit-msg/commitlint.sh | 4 ++++ packages/lefthook-config/README.md | 10 +++++++++- packages/lefthook-config/scripts/commitlint.sh | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .lefthook/commit-msg/commitlint.sh 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