Improve error message on CI format check failure
@@ -24,7 +24,14 @@ jobs:
- checkout
- run: *linux-setup
- run: cppcheck . --error-exitcode=1
- - run: bash clang-format.sh --verbose && git diff-index --quiet HEAD
+ - run: bash clang-format.sh --verbose
+ - run: >
+ if ! $(git diff-index --quiet HEAD); then
+ echo "Code formatting doesn't conform to clang-format"
+ echo "Please run clang-format.sh, commit the diff, and push to re-run CI"
+ echo "Excerpt of the diff follows"
+ git diff | head -n 20
+ fi
- run: >
cd doc &&
pip3 install -r source/requirements.txt &&
