Skip to content

Commit

Permalink
Merge pull request #36 from tatsutakein/rt/migrate-husky-to-lefthook
Browse files Browse the repository at this point in the history
feat: husky -> lefthook へ置き換え
  • Loading branch information
tatsutakein authored Mar 2, 2024
2 parents 7b46cf5 + d6c083f commit 7423585
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 16 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
5 changes: 0 additions & 5 deletions .husky/commit-msg

This file was deleted.

3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bun 1.0.29
bun 1.0.29
lefthook 1.6.4
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ What is being processed by bootstrap is shown below.
- Configuring git commit message templates
- Installation of various tools by mise
- Installation of dependencies by bun
- Installation of husky by bun

### Add template

Expand Down
Binary file modified bun.lockb
Binary file not shown.
40 changes: 40 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
commit-msg:
commands:
"lint commit message":
run: bun run commitlint --edit {1}

# pre-push:
# commands:
# packages-audit:
# tags: frontend security
# run: yarn audit
# gems-audit:
# tags: backend security
# run: bundle audit
#
# pre-commit:
# parallel: true
# commands:
# eslint:
# glob: "*.{js,ts,jsx,tsx}"
# run: yarn eslint {staged_files}
# rubocop:
# tags: backend style
# glob: "*.rb"
# exclude: '(^|/)(application|routes)\.rb$'
# run: bundle exec rubocop --force-exclusion {all_files}
# govet:
# tags: backend style
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
# scripts:
# "hello.js":
# runner: node
# "any.go":
# runner: go run
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"devDependencies": {
"@commitlint/cli": "19.0.3",
"@commitlint/config-conventional": "19.0.3",
"husky": "9.0.11",
"plop": "4.0.1"
}
}
16 changes: 8 additions & 8 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ fi

##############################################################################
##
## husky
## lefthook
##
##############################################################################
echo ""
echo "🚀 husky install: Start"
if type bun >/dev/null 2>&1; then
if bun husky; then
echo "husky install: Success"
echo "🚀 lefthook install: Start"
if type lefthook >/dev/null 2>&1; then
if lefthook install; then
echo "lefthook install: Success"
else
echo "🚫 husky install: Failed"
echo "🚫 lefthook install: Failed"
fi
else
echo "⚠️ husky install: Skip bun because it could not be found."
echo "⚠️ husky install: This may be due to the fact that the mise installation has not been completed."
echo "⚠️ lefthook install: Skip bun because it could not be found."
echo "⚠️ lefthook install: This may be due to the fact that the mise installation has not been completed."
fi

##############################################################################
Expand Down

0 comments on commit 7423585

Please sign in to comment.