-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: pre-commit 시 spotlessApply 실행 (#412)
* fix: pre-commit test
- Loading branch information
Showing
2 changed files
with
15 additions
and
12 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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
#!/bin/bash | ||
echo "Running spotless check" | ||
./gradlew spotlessCheck | ||
if [ \$? -eq 0 ] | ||
then | ||
echo "Spotless check succeed" | ||
else | ||
echo "Spotless check failed" >&2 | ||
exit 1 | ||
fi | ||
#!/bin/sh | ||
|
||
targetFiles=$(git diff --staged --name-only) | ||
|
||
echo "Apply Spotless.." | ||
./gradlew spotlessApply | ||
|
||
# Add files to stage spotless applied | ||
for file in $targetFiles; do | ||
if test -f "$file"; then | ||
git add $file | ||
fi | ||
done |