From cfc119f3111c4cccdb6b88de1f70c72fd894515f Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 7 May 2024 14:53:32 -0300 Subject: [PATCH] feat: check for formatting errors when committing --- .hooks/pre-commit | 4 ++++ deno.json | 1 + 2 files changed, 5 insertions(+) create mode 100755 .hooks/pre-commit diff --git a/.hooks/pre-commit b/.hooks/pre-commit new file mode 100755 index 0000000..ce8d809 --- /dev/null +++ b/.hooks/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/hook.sh" + +deno fmt --check diff --git a/deno.json b/deno.json index 66263f5..5debcfd 100644 --- a/deno.json +++ b/deno.json @@ -4,6 +4,7 @@ "tasks": { "start": "deno run -A src/server.ts", "dev": "deno run -A --watch src/server.ts", + "hook": "deno run --allow-read --allow-run --allow-write https://deno.land/x/deno_hooks@0.1.1/mod.ts", "debug": "deno run -A --inspect src/server.ts", "test": "DATABASE_URL=\"sqlite://:memory:\" deno test -A --junit-path=./deno-test.xml", "check": "deno check src/server.ts",