diff --git a/.bin/git-hooks/pre-commit b/.bin/git-hooks/pre-commit new file mode 100755 index 0000000..316df36 --- /dev/null +++ b/.bin/git-hooks/pre-commit @@ -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 diff --git a/.gitignore b/.gitignore index 9eedf0e..532fe44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .bin/* +!.bin/git-hooks !.bin/.gitkeep !.bin/public-to-json.ts share diff --git a/deno.json b/deno.json index a83b25e..256ee61 100644 --- a/deno.json +++ b/deno.json @@ -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" }, @@ -17,7 +18,7 @@ } }, "fmt": { - "exclude": [".cache/"] + "exclude": [".cache/", "./src/public.json"] }, "imports": { "@std/encoding": "jsr:@std/encoding@0.221.0",