spring-io/spring-javaformat

Unable to run 'apply' within Pre-Commit Git Hook script

firasrg opened this issue · 1 comments

Hello !

i'm building a Git Hook Script :

#!/bin/sh

./mvnw spring-javaformat:apply

When I commit, i notice:

  • The command passes (i verify my Git Console),
  • The file is commited successfully without formatting changes
  • The formatting changes are then applied and NOT commited

I tried many ways to make it happen but no one works, I'm wondering why and what is the way out for this ?