nheko/.ci/format.sh

16 lines
286 B
Bash
Raw Normal View History

#!/usr/bin/env sh
2017-09-24 16:08:11 +02:00
# Runs the Clang Formatter
# Return codes:
# - 1 there are files to be formatted
# - 0 everything looks fine
set -eu
2017-09-24 16:08:11 +02:00
FILES=$(find src -type f -type f \( -iname "*.cpp" -o -iname "*.h" \))
2017-09-24 16:08:11 +02:00
for f in $FILES
do
clang-format -i "$f" && git diff --exit-code
done;