Skip to content

Commit

Permalink
how to install spotless git hook (getsentry/sentry-android#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored and bruno-garcia committed Nov 11, 2019
1 parent 1ac0485 commit 961e4a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -4,6 +4,12 @@ We love pull requests from everyone.

The project currently requires you run JDK version `1.8.x`.

To install spotlessCheck pre-commit hook:

```shell
git config core.hooksPath hooks/
```

To run the build and tests:

```shell
Expand Down
13 changes: 13 additions & 0 deletions hooks/pre-commit
@@ -0,0 +1,13 @@
#!/bin/sh
# From gist at https://gist.github.com/chadmaughan/5889802

echo '[git hook] executing gradle spotlessCheck before commit'

# run the spotlessCheck with the gradle wrapper
./gradlew spotlessCheck --daemon

# store the last exit code in a variable
RESULT=$?

# return the './gradlew spotlessCheck' exit code
exit $RESULT

0 comments on commit 961e4a7

Please sign in to comment.