Skip to content

Commit 0061801

Browse files
committed
chore: update pre-commit hooks
1 parent a1036cc commit 0061801

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.git-hooks/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
FILES=$(git diff --staged --name-only --diff-filter=ACMR)
5+
echo "$FILES" | grep '[jt]sx\?$' | xargs --no-run-if-empty deno lint
6+
echo "$FILES" | grep '\([jt]sx\?\|jsonc\?\|md\)$' | xargs --no-run-if-empty deno fmt

velociraptor.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ scripts:
3434
cmd: deno fmt --ignore=cov_profile
3535

3636
pre-commit:
37-
cmd: |
38-
FILES=$(git diff --staged --name-only --diff-filter=ACMR "*.ts")
39-
[ -z "$FILES" ] && exit 0
40-
echo "$FILES" | xargs deno lint
41-
echo "$FILES" | xargs deno fmt
42-
# echo "$FILES" | xargs git add
37+
cmd: sh .git-hooks/pre-commit
4338
desc: Lints and formats staged files
4439
gitHook: pre-commit
4540

0 commit comments

Comments
 (0)