Browse Source

chore: add install gitlint script & ignore body length

appflowy 2 years ago
parent
commit
ca50e61762

+ 1 - 2
.githooks/commit-msg

@@ -36,10 +36,9 @@ test "" = "$(grep '^Signed-off-by: ' "$1" |
 .githooks/gitlint \
 	 --msg-file=$1 \
 	 --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*" \
-    --subject-maxlen=100 \
+    --subject-maxlen=150 \
     --subject-minlen=10 \
     --body-regex=".*" \
-    --body-maxlen=200 \
     --max-parents=1
 
 if [ $? -ne 0 ]

+ 2 - 0
frontend/scripts/install_dev_env/install_macos.sh

@@ -34,6 +34,8 @@ else
    printMessage "Skipping Rust installation."
 fi
 
+abvc
+
 # Install sqllite
 printMessage "Installing sqlLite3."
 brew install sqlite3 

+ 35 - 9
frontend/scripts/makefile/env.toml

@@ -121,15 +121,6 @@ rbenv global 2.7.1
 curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
 """
 
-[tasks.install_fish]
-script = """
-brew install fish
-
-# https://stackoverflow.com/questions/26208231/modifying-path-with-fish-shell
-# Export the PATH using the command:
-# set -Ua fish_user_paths the_path_you_want_to_export
-"""
-
 [tasks.install_flutter]
 script = """
 ret = which flutter
@@ -141,3 +132,38 @@ end
 """
 script_runner = "@duckscript"
 
+
+[tasks.enable_git_hook]
+dependencies=["download_gitlint"]
+script = """
+git config core.hooksPath .githooks
+"""
+script_runner = "@duckscript"
+
+[tasks.download_gitlint]
+script = """
+GOLINT_FILENAME="go-gitlint_1.1.0_osx_x86_64.tar.gz"
+curl -L https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME} --output ${GOLINT_FILENAME}
+tar -zxv --directory ../.githooks/. -f ${GOLINT_FILENAME} gitlint 
+rm ${GOLINT_FILENAME}
+"""
+
+[tasks.download_gitlint.linux]
+script = """
+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}
+"""
+
+
+[tasks.download_gitlint.windows]
+script = """
+GOLINT_FILENAME="go-gitlint_1.1.0_windows_x86_64.tar.gz"
+if curl --proto '=https' --tlsv1.2 -sSfL https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME} -o ${GOLINT_FILENAME}; then
+   tar -zxv --directory ../.githooks/. -f ${GOLINT_FILENAME} gitlint.exe
+   rm ${GOLINT_FILENAME}
+else
+ echo "Failed to install go-gitlint"
+fi
+"""