Skip to content

Commit 8206e58

Browse files
authored
Merge pull request #1115 from AppFlowy-IO/fix/git_commit_msg
chore: add install gitlint script & ignore body length
2 parents 3cd9ea5 + ca50e61 commit 8206e58

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

.githooks/commit-msg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ test "" = "$(grep '^Signed-off-by: ' "$1" |
3636
.githooks/gitlint \
3737
--msg-file=$1 \
3838
--subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*" \
39-
--subject-maxlen=100 \
39+
--subject-maxlen=150 \
4040
--subject-minlen=10 \
4141
--body-regex=".*" \
42-
--body-maxlen=200 \
4342
--max-parents=1
4443

4544
if [ $? -ne 0 ]

frontend/scripts/install_dev_env/install_macos.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ else
3434
printMessage "Skipping Rust installation."
3535
fi
3636

37+
abvc
38+
3739
# Install sqllite
3840
printMessage "Installing sqlLite3."
3941
brew install sqlite3

frontend/scripts/makefile/env.toml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,6 @@ rbenv global 2.7.1
121121
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
122122
"""
123123

124-
[tasks.install_fish]
125-
script = """
126-
brew install fish
127-
128-
# https://stackoverflow.com/questions/26208231/modifying-path-with-fish-shell
129-
# Export the PATH using the command:
130-
# set -Ua fish_user_paths the_path_you_want_to_export
131-
"""
132-
133124
[tasks.install_flutter]
134125
script = """
135126
ret = which flutter
@@ -141,3 +132,38 @@ end
141132
"""
142133
script_runner = "@duckscript"
143134

135+
136+
[tasks.enable_git_hook]
137+
dependencies=["download_gitlint"]
138+
script = """
139+
git config core.hooksPath .githooks
140+
"""
141+
script_runner = "@duckscript"
142+
143+
[tasks.download_gitlint]
144+
script = """
145+
GOLINT_FILENAME="go-gitlint_1.1.0_osx_x86_64.tar.gz"
146+
curl -L https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME} --output ${GOLINT_FILENAME}
147+
tar -zxv --directory ../.githooks/. -f ${GOLINT_FILENAME} gitlint
148+
rm ${GOLINT_FILENAME}
149+
"""
150+
151+
[tasks.download_gitlint.linux]
152+
script = """
153+
GOLINT_FILENAME="go-gitlint_1.1.0_linux_x86_64.tar.gz"
154+
wget https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME}
155+
tar -zxv --directory ../.githooks/. -f ${GOLINT_FILENAME} gitlint
156+
rm ${GOLINT_FILENAME}
157+
"""
158+
159+
160+
[tasks.download_gitlint.windows]
161+
script = """
162+
GOLINT_FILENAME="go-gitlint_1.1.0_windows_x86_64.tar.gz"
163+
if curl --proto '=https' --tlsv1.2 -sSfL https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME} -o ${GOLINT_FILENAME}; then
164+
tar -zxv --directory ../.githooks/. -f ${GOLINT_FILENAME} gitlint.exe
165+
rm ${GOLINT_FILENAME}
166+
else
167+
echo "Failed to install go-gitlint"
168+
fi
169+
"""

0 commit comments

Comments
 (0)