-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pre-commit-hook to run spotlessCheck
Signed-off-by: VishnuSanal <[email protected]>
- Loading branch information
1 parent
3c5a2f6
commit c8b895b
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# ref: gist at https://gist.github.com/chadmaughan/5889802 | ||
|
||
# stash any unstaged changes | ||
git stash -q --keep-index | ||
|
||
# run the tests with the gradle wrapper | ||
./gradlew spotlessCheck --full-stacktrace | ||
|
||
# store the last exit code in a variable | ||
RESULT=$? | ||
|
||
# unstash the unstashed changes | ||
git stash pop -q | ||
|
||
# if [[ $RESULT != 0 ]]; then | ||
# echo "Formatting violations detected! Please run ./gradlew spotlessApply to fix the formatting errors." | ||
# fi | ||
|
||
# return the './gradlew test' exit code | ||
exit $RESULT |