diff --git a/.githooks/pre-push b/.githooks/pre-push index e8fca06..0d4df0e 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -1,5 +1,21 @@ #!/bin/sh +echo "Checking for unstaged changes..." +git diff --exit-code +EXIT_CODE=$? + +if [ $EXIT_CODE -ne 0 ]; then + echo "" + echo "======================================" + echo "Unstaged changes detected. Please stage or discard changes before running this script." + echo "======================================" + echo "" + exit 1 +fi + +echo "No unstaged changes found." +echo "" + echo "Running scalafmt check..." echo "" sbt scalafmtCheckAll