diff --git a/resources/build/jq-win64.exe b/resources/build/jq-win64.exe index 81685175b5..cf9f37e4bc 100644 Binary files a/resources/build/jq-win64.exe and b/resources/build/jq-win64.exe differ diff --git a/resources/git-hooks/commit-msg b/resources/git-hooks/commit-msg index d9963eb5e7..b027025dfe 100755 --- a/resources/git-hooks/commit-msg +++ b/resources/git-hooks/commit-msg @@ -15,11 +15,11 @@ # Get the directory where this script lives, i.e. resources/git-hooks HOOK_DIRECTORY="$(dirname "$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")")" -if [ -f $(dirname "${BASH_SOURCE[0]}")/commit-msg-defs ]; then - . $(dirname "${BASH_SOURCE[0]}")/commit-msg-defs -else - . $HOOK_DIRECTORY/commit-msg-defs -fi +. "$HOOK_DIRECTORY/../build/jq.inc.sh" +. "$HOOK_DIRECTORY/commit-msg-defs" + +scopes=( $("$JQ" -r '[.scopes | paths | reduce .[] as $item (""; if . == "" then $item else . + "/" + $item end)] | join(" ")' < "$HOOK_DIRECTORY/../scopes/scopes.json") ) +types=( $("$JQ" -r '.commitTypes | join(" ")' < "$HOOK_DIRECTORY/../scopes/commit-types.json") ) # # Define terminal colours. diff --git a/resources/git-hooks/commit-msg-defs b/resources/git-hooks/commit-msg-defs index 71a5b7f77c..c1ad9477d1 100755 --- a/resources/git-hooks/commit-msg-defs +++ b/resources/git-hooks/commit-msg-defs @@ -2,17 +2,5 @@ # Configurable options for types, scopes and message length. # -types=(fix feat chore change docs style refactor test auto) -scopes=( \ - android android/app android/browser android/engine android/oem \ - ci \ - common common/core common/lmlayer \ - developer developer/compiler developer/ide developer/tools \ - ios ios/app ios/browser ios/engine ios/oem \ - linux linux/config linux/engine linux/ibus linux/oem \ - mac mac/config mac/engine mac/oem \ - web web/engine web/oem web/ui \ - windows windows/config windows/engine windows/oem \ -) min_length=4 max_length=128 diff --git a/resources/scopes/commit-types.json b/resources/scopes/commit-types.json new file mode 100644 index 0000000000..6adb5b0add --- /dev/null +++ b/resources/scopes/commit-types.json @@ -0,0 +1,13 @@ +{ + "commitTypes": [ + "fix", + "feat", + "chore", + "change", + "docs", + "style", + "refactor", + "test", + "auto" + ] +} \ No newline at end of file diff --git a/resources/scopes/scopes.json b/resources/scopes/scopes.json new file mode 100644 index 0000000000..bcad1d4b43 --- /dev/null +++ b/resources/scopes/scopes.json @@ -0,0 +1,62 @@ +{ + "scopes": { + "android": { + "app": null, + "browser": null, + "engine": null, + "resources": null, + "samples": null + }, + "ios": { + "app": null, + "browser": null, + "engine": null, + "resources": null, + "samples": null + }, + "linux": { + "config": null, + "engine": null, + "resources": null, + "samples": null + }, + "web": { + "engine": null, + "resources": null, + "ui": null, + "samples": null + }, + "mac": { + "config": null, + "engine": null, + "resources": null, + "samples": null + }, + "developer": { + "compilers": null, + "ide": null, + "resources": null, + "tools": null + }, + "common": { + "core": { + "desktop": null, + "web": null + }, + "model": { + "types": null, + "templates": null, + "wordbreakers": null + }, + "resources": null, + "ci": null + }, + "oem": { + "fv": { + "android": null, + "ios": null, + "linux": null + } + } + } +} \ No newline at end of file