From ede8db616534ef0e52f392b705f2460cab3131df Mon Sep 17 00:00:00 2001 From: sburman Date: Tue, 22 Sep 2026 12:42:48 +0530 Subject: [PATCH] Add pre-commit hook running tests before commit No committed Maven artifact reference embeds a fetch host the way npm/gems do, and no CI lockfile-hygiene gate exists yet for this ecosystem, so this only wires up the baseline hook (matching twilio-node/php/ruby/go/python): a githooks Makefile target that make install symlinks to .git/hooks/pre-commit, running make test before each commit. Co-Authored-By: Claude Sonnet 5 --- Makefile | 7 +++++-- githooks/pre-commit | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 githooks/pre-commit diff --git a/Makefile b/Makefile index 9192665431..df1c2b59ca 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ -.PHONY: install analysis test test-docker docs +.PHONY: githooks install analysis test test-docker docs -install: +githooks: + ln -sf ../../githooks/pre-commit .git/hooks/pre-commit + +install: githooks @java -version || (echo "Java is not installed, please install Java >= 7"; exit 1); mvn clean install mvn dependency:resolve-plugins diff --git a/githooks/pre-commit b/githooks/pre-commit new file mode 100755 index 0000000000..b1c070a558 --- /dev/null +++ b/githooks/pre-commit @@ -0,0 +1 @@ +make test