chore(common/resources): use shared scopes definition

This starts the shared scope definition. First cab off the rank is commit-msg
This commit is contained in:
Marc Durdin 2020-05-19 17:08:57 +10:00
parent 3575691ef9
commit 13b44a7e30
5 changed files with 80 additions and 17 deletions

Binary file not shown.

View file

@ -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.

View file

@ -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

View file

@ -0,0 +1,13 @@
{
"commitTypes": [
"fix",
"feat",
"chore",
"change",
"docs",
"style",
"refactor",
"test",
"auto"
]
}

View file

@ -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
}
}
}
}