mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-27 00:28:10 +00:00
15 lines
360 B
Bash
Executable File
15 lines
360 B
Bash
Executable File
#!/usr/bin/env bash
|
|
error=0
|
|
for f in $*; do
|
|
changes=$(clang-format -output-replacements-xml "$f" | grep -c '^<replacement '; exit ${PIPESTATUS[0]})
|
|
if [ "$?" -ne "0" ]; then
|
|
echo "clang-format failed"
|
|
exit 1
|
|
fi
|
|
if test "$changes" -gt 0; then
|
|
echo "$f ... $changes changes needed"
|
|
error=1
|
|
fi
|
|
done
|
|
exit $error
|