Skip to content

Commit

Permalink
Merge pull request #759 from 42organization/Feat/update-development-s…
Browse files Browse the repository at this point in the history
…etup-#758

Feat/update development setup #758
  • Loading branch information
mike2ox authored Mar 16, 2023
2 parents 8290c2a + 5b2cd3e commit c099d6b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 모든 PR의 리뷰어로 해당 팀 멤버들을 설정

* @42organization/fe_2nd
# * @42organization/fe_2nd
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,4 @@ yarn-error.log*

.history

.husky

.eslintcache
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

if [ $(git rev-parse --abbrev-ref HEAD) = 'deploy' ]; then
echo 'You cannot commit directly to the deploy branch'
exit 1
fi

npx lint-staged
18 changes: 18 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
branch_name=$(git symbolic-ref --short HEAD)

commit_msg_title=$(head -n 1 $1)
commit_msg_body=$(tail -n +2 $1)
issue_number=$(echo $branch_name | sed -n 's/^.*#\([0-9]*\)$/\1/p')
issue_number_in_msg=$(grep -c "\#$issue_number" $1)

if [[ -n $issue_number ]] && [[ ! $issue_number_in_msg -ge 1 ]]; then
# echo "$commit_msg #$issue_number" > $1
echo "$commit_msg_title #$issue_number" > $1
if [[ -n $commit_msg_body ]]; then
echo "$commit_msg_body" >> $1
fi
else
echo "check issue number in branch name"
exit 1
fi

0 comments on commit c099d6b

Please sign in to comment.