-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: issue162 - Enforce conventional commits and fix lintKotlin
- Loading branch information
1 parent
86c410f
commit 520443e
Showing
4 changed files
with
51 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/zsh | ||
|
||
if ! head -1 "$1" | grep -qE "^(feat|fix|ci|chore|docs|test|style|refactor|revert|perf)(\(.+?\))?: .{1,}$"; then | ||
echo "Aborting commit. Your commit message is invalid." >&2 | ||
exit 1 | ||
fi | ||
|
||
if ! head -1 "$1" | grep -qE "^.{1,72}$"; then | ||
echo "Aborting commit. Your commit message is too long." >&2 | ||
exit 1 | ||
fi |
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,30 @@ | ||
#!/bin/zsh | ||
echo "*******************************" | ||
echo "Running git pre-commit hook" | ||
echo "*******************************" | ||
|
||
echo "Running lintKotlin" | ||
if ! lintKotlinStatus=$(./gradlew lintKotlin --parallel --max-workers=4); then | ||
echo "lintKotlin must pass before commit!" | ||
exit "$lintKotlinStatus" | ||
fi | ||
|
||
echo "Running detekt" | ||
if ! detektStatus=$(./gradlew detekt --parallel --max-workers=4); then | ||
echo "detekt must pass before commit!" | ||
exit "$detektStatus" | ||
fi | ||
|
||
echo "Running lintDebug" | ||
if ! lintDebugStatus=$(./gradlew lintDebug --parallel --max-workers=4); then | ||
echo "lintDebug must pass before commit!" | ||
exit "$lintDebugStatus" | ||
fi | ||
|
||
echo "Running cpdCheck" | ||
if ! cpdCheckStatus=$(./gradlew cpdCheck --parallel --max-workers=4); then | ||
echo "cpdCheck must pass before commit!" | ||
exit "$cpdCheckStatus" | ||
fi | ||
|
||
echo "'Hard work pays off if you’re patient enough to see it through.' — Michael Chandler" |
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,10 @@ | ||
#!/bin/zsh | ||
echo "*******************************" | ||
echo "Running git pre-push hook" | ||
echo "*******************************" | ||
|
||
# todo@patches Consider building and running unit tests here | ||
|
||
# todo@patches Consider building test APK for instrumentation here | ||
|
||
echo "'Do the hard jobs first. The easy jobs will take care of themselves.' — Dale Carnegie " |
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