Skip to content

Commit

Permalink
Add pre-commit hook
Browse files Browse the repository at this point in the history
Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com>
  • Loading branch information
M4RC3L05 committed Apr 30, 2024
1 parent 300736c commit 5f0d932
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .bin/git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

echo "Check code format..."
echo -n " => "
deno fmt --check

echo "Check code lint..."
echo -n " => "
deno lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.bin/*
!.bin/git-hooks
!.bin/.gitkeep
!.bin/public-to-json.ts
share
Expand Down
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"tasks": {
"run": "./.bin/public-to-json.ts && deno run -A --unstable-ffi --cached-only --lock=deno.lock src/main.ts",
"compile": "./.bin/public-to-json.ts && deno compile -A --unstable-ffi --include ./src/public.json --cached-only --lock=deno.lock -o ./.bin/denotag ./src/main.ts",
"dev:boot": "git config core.hooksPath ./.bin/git-hooks/ && deno task deps",
"deps:lock": "deno cache --lock=deno.lock --lock-write src/*.ts src/**/*.ts src/**/*.tsx ./.bin/*.ts",
"deps": "deno cache --reload --lock=deno.lock src/*.ts src/**/*.ts src/**/*.tsx ./.bin/*.ts"
},
Expand All @@ -17,7 +18,7 @@
}
},
"fmt": {
"exclude": [".cache/"]
"exclude": [".cache/", "./src/public.json"]
},
"imports": {
"@std/encoding": "jsr:@std/encoding@0.221.0",
Expand Down

0 comments on commit 5f0d932

Please sign in to comment.