From da3f00acb65a6c49429b38b57bbef414c48f9518 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sun, 30 Jul 2023 23:33:51 +0200 Subject: [PATCH] added precommit hook --- .gitignore | 3 ++- Makefile | 4 ++++ pre-commit.sh | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 pre-commit.sh diff --git a/.gitignore b/.gitignore index b1f9f76..6f63b81 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /build -/node_modules \ No newline at end of file +/node_modules +/dump diff --git a/Makefile b/Makefile index b8148d1..9c371dc 100644 --- a/Makefile +++ b/Makefile @@ -55,3 +55,7 @@ emulator: .PHONY: webconsole webconsole: node console.js + +.PHONY: format +format: + haxelib run formatter -s src \ No newline at end of file diff --git a/pre-commit.sh b/pre-commit.sh new file mode 100755 index 0000000..b65a00d --- /dev/null +++ b/pre-commit.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +# Run: +# ln -s ../../pre-commit.sh .git/hooks/pre-commit + +set -e + +# format + +make format + +# build + +make build +