Skip to content

Instantly share code, notes, and snippets.

View henrico-lazuroz's full-sized avatar
🏠
Working from home

Henrico Lazuroz henrico-lazuroz

🏠
Working from home
View GitHub Profile
@franklsm1
franklsm1 / INSTRUCTIONS.md
Last active June 19, 2024 15:11
Auto configure pre-commit hooks for a Gradle Spring App

Steps

  1. create a file called "pre-commit" with no extension in the project directory root
  2. add the code from the pre-commit file below into that new file
  3. create a new file called "preCommit.gradle" inside of the root gradle folder
  4. add the code from the preCommit.gradle file below into that new file
  5. add the following line at the end of the build.gradle file:
    • apply from: "$projectDir/gradle/preCommit.gradle"

Now when you run the ./gradlew build command the git pre-commit hook will be automatically setup.