diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..ec76c76 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,11 @@ +#!/bin/sh +# +# An example hook script to verify proper formatting. + +files=$(git diff --cached --name-only --diff-filter=ACM | paste -s -d",") +# this only works if ignoreFailures is set to false (which it is by default) +./gradlew verifyGJF -DverifyGoogleJavaFormat.include="$files" &>/dev/null && exit 0 + +echo "Some files are not formatted properly. Please run:" +echo "./gradlew gJF -DgoogleJavaFormat.include=\"$files\"" +exit 1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index cbe2fae..be46261 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ test*.properties test*.xml *.log !src/test/**/*.log +test-check-files-output/ diff --git a/build.gradle b/build.gradle index d4e139d..0f6376f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { id 'com.github.sherter.google-java-format' version '0.8' + id 'com.gtramontina.ghooks.gradle' version '1.1.0' } apply plugin: 'eclipse' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 21d0965..2812ffa 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2bad1db..b0434c1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jul 12 11:19:13 CDT 2019 +#Tue Jun 09 16:59:18 MST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip