Skip to content

Commit

Permalink
chore: update pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed Apr 29, 2022
1 parent a1036cc commit 0061801
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

FILES=$(git diff --staged --name-only --diff-filter=ACMR)
echo "$FILES" | grep '[jt]sx\?$' | xargs --no-run-if-empty deno lint
echo "$FILES" | grep '\([jt]sx\?\|jsonc\?\|md\)$' | xargs --no-run-if-empty deno fmt
7 changes: 1 addition & 6 deletions velociraptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ scripts:
cmd: deno fmt --ignore=cov_profile

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

Expand Down

0 comments on commit 0061801

Please sign in to comment.