Slightly friendlier pre-commit errors.
Make the pre-commit check spit out cut-and-paste commands and be more obvious about errors. Tested by making an invalid change and observing the message generated.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$(grep -c "# then delete this line" $1)" == "1" ]]; then
|
||||
echo "Unresolved gofmt errors. Aborting commit."
|
||||
if [[ "$(grep -c "COMMIT_BLOCKED" $1)" -gt 0 ]]; then
|
||||
echo "FAILED: Unresolved errors - aborting the commit."
|
||||
echo "The message of your attempted commit was:"
|
||||
cat $1
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user