Skip to content

Commit b070dba

Browse files
committed
install lefthook
1 parent bd7142b commit b070dba

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

Makefile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ dev-db:
8080
@make seed;
8181
@echo "Seeding completed."
8282

83-
84-
precommit: check-branch lint-staged spell-check
85-
86-
lint-staged:
87-
bunx lint-staged
88-
check-branch:
89-
@ if [ "$(git branch --show-current)" == "main" ]; then echo "Cannot make commit on main! aborting..."; exit 1; fi
90-
spell-check:
91-
bunx cspell --quiet .
92-
9383
# Sync (install/update packages, generate prisma, etc)
9484

9585
sync-web:

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
biome
2828
pkg-config
2929
openssl
30+
lefthook
3031
] ++ [
3132
rust-pkgs
3233
];

lefthook.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Lefthook: Precommit Hook
2+
# docs: https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
3+
# 必須: Lefthook
4+
# 必須: `lefthook install`
5+
# 関連: Husky (互換: Lefthook のほうが多機能)
6+
pre-commit:
7+
parallel: true
8+
commands:
9+
biome:
10+
glob: "*"
11+
run: biome check --write --no-errors-on-unmatched --files-ignore-unknown=true -- {staged_files}
12+
stage_fixed: true
13+
prevent-commit-on-main:
14+
run: if [ "$(git branch --show-current)" == "main" ]; then echo "Cannot make commit on main! aborting..."; exit 1; fi
15+
cspell:
16+
glob: "*"
17+
run: bunx cspell --quiet -- {staged_files}

0 commit comments

Comments
 (0)