mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 22:57:12 -04:00
feat: add gitlint dependency
This commit is contained in:
parent
943ce37623
commit
f993e1d076
4 changed files with 28 additions and 7 deletions
|
@ -16,7 +16,14 @@ test "" = "$(grep '^Signed-off-by: ' "$1" |
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
npx --no -- commitlint --edit $1
|
.githooks/gitlint \
|
||||||
|
--msg-file=$1 \
|
||||||
|
--subject-regex="^([bB]uild|[cC]hore|[cC]i|[dD]ocs|[fF]eat|[fF]eature|[fF]ix|[pP]erf|[rR]efactor|[rR]evert|[sS]tyle|[tT]est)(.*)?\s?:\s?.*" \
|
||||||
|
--subject-maxlen=100 \
|
||||||
|
--subject-minlen=10 \
|
||||||
|
--body-regex=".*" \
|
||||||
|
--body-maxlen=200 \
|
||||||
|
--max-parents=1
|
||||||
|
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -32,3 +32,6 @@ frontend/.vscode/*
|
||||||
# Commit the highest level pubspec.lock, but ignore the others
|
# Commit the highest level pubspec.lock, but ignore the others
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
!frontend/app_flowy/pubspec.lock
|
!frontend/app_flowy/pubspec.lock
|
||||||
|
|
||||||
|
# ignore tool used for commit linting
|
||||||
|
.githooks/gitlint
|
||||||
|
|
|
@ -50,6 +50,13 @@ flutter doctor
|
||||||
printMessage "Setting up githooks."
|
printMessage "Setting up githooks."
|
||||||
git config core.hooksPath .githooks
|
git config core.hooksPath .githooks
|
||||||
|
|
||||||
|
# Install go-gitlint
|
||||||
|
printMessage "Installing go-gitlint."
|
||||||
|
GOLINT_FILENAME="go-gitlint_1.1.0_linux_x86_64.tar.gz"
|
||||||
|
wget https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME}
|
||||||
|
tar -zxv --directory .githooks/. -f ${GOLINT_FILENAME} gitlint
|
||||||
|
rm ${GOLINT_FILENAME}
|
||||||
|
|
||||||
# Change to the frontend directory
|
# Change to the frontend directory
|
||||||
cd frontend
|
cd frontend
|
||||||
|
|
||||||
|
@ -62,8 +69,9 @@ printMessage "Installing duckscript."
|
||||||
cargo install --force duckscript_cli
|
cargo install --force duckscript_cli
|
||||||
|
|
||||||
# Install CommitLint
|
# Install CommitLint
|
||||||
printMessage "Installing CommitLint."
|
printMessage "Installing go-gitlint."
|
||||||
npm install @commitlint/cli @commitlint/config-conventional --save-dev
|
wget https://github.com/llorllale/go-gitlint/releases/download/1.1.0/go-gitlint_1.1.0_linux_x86_64.tar.gz
|
||||||
|
tar -xf go-gitlint_1.1.0_linux_x86_64.tar.gz - C
|
||||||
|
|
||||||
# Check prerequisites
|
# Check prerequisites
|
||||||
printMessage "Checking prerequisites."
|
printMessage "Checking prerequisites."
|
||||||
|
|
|
@ -50,6 +50,13 @@ flutter doctor
|
||||||
printMessage "Setting up githooks."
|
printMessage "Setting up githooks."
|
||||||
git config core.hooksPath .githooks
|
git config core.hooksPath .githooks
|
||||||
|
|
||||||
|
# Install go-gitlint
|
||||||
|
printMessage "Installing go-gitlint."
|
||||||
|
GOLINT_FILENAME="go-gitlint_1.1.0_osx_x86_64.tar.gz"
|
||||||
|
wget https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME}
|
||||||
|
tar -zxv --directory .githooks/. -f ${GOLINT_FILENAME} gitlint
|
||||||
|
rm ${GOLINT_FILENAME}
|
||||||
|
|
||||||
# Change to the frontend directory
|
# Change to the frontend directory
|
||||||
cd frontend
|
cd frontend
|
||||||
|
|
||||||
|
@ -61,10 +68,6 @@ cargo install --force cargo-make
|
||||||
printMessage "Installing duckscript."
|
printMessage "Installing duckscript."
|
||||||
cargo install --force duckscript_cli
|
cargo install --force duckscript_cli
|
||||||
|
|
||||||
# Install CommitLint
|
|
||||||
printMessagae "Installing CommitLint."
|
|
||||||
npm install @commitlint/cli @commitlint/config-conventional --save-dev
|
|
||||||
|
|
||||||
# Check prerequisites
|
# Check prerequisites
|
||||||
printMessage "Checking prerequisites."
|
printMessage "Checking prerequisites."
|
||||||
cargo make flowy_dev
|
cargo make flowy_dev
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue