CI: better checking of formatting

This commit is contained in:
zv0n 2021-10-18 09:08:21 +02:00
parent d60dc07e10
commit f3062464d2

View File

@ -28,7 +28,4 @@ steps:
image: cppbuilder:v0.4
commands:
- cd mario
- FORMAT="ok"
- while read f ; do clang-format -style=file "$f" > temp.pp ; if [ $(diff temp.pp "$f" | wc -l) -gt 0 ] ; then echo "$f needs reformatting" ; FORMAT="nok" ; fi ; done <<< "$(find . -iname '*pp')"
- rm temp.pp
- if [ "$FORMAT" == "nok" ] ; then exit 1 ; fi
- find . -path "./build" -prune -or \( -iname "*.cpp" -or -iname "*.hpp" \) | xargs -P0 -I{} clang-format -style=file --dry-run -Werror {}