Skip to content

Commit

Permalink
show git diff after failed lint only during CI
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
  • Loading branch information
ckadner committed Jan 24, 2024
1 parent bce973f commit 6006857
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ elif [ "$RETURN_CODE" -ne 0 ]; then
fi
if [ "${CI}" != "true" ]; then
echoError 'Pre-commit linter failed, but it may have automatically formatted your files.'
echoError 'Check your changed files and/or manually fix the errors above then stage and commit.'
echoError 'Check your changed files and/or manually fix the errors above.'
else
echoError "This test failed because your code isn't formatted and linted correctly."
echoError 'To format and check the linter locally, run `make fmt`. It will appear to'
echoError 'fail, but may automatically format some files. Stage the changed files and'
echoError 'manually correct any other issues before committing and building again.'
echoError 'To format and check the linter locally, run `make fmt` or `make run fmt`.'
echoError 'It will appear to fail, but may automatically format some files.'
echoError 'Manually correct any other issues before committing and building again.'
git diff -R --ws-error-highlight=all --color --exit-code
fi
git diff -R --ws-error-highlight=all --color --exit-code
fi

exit $RETURN_CODE

0 comments on commit 6006857

Please sign in to comment.