matrixion/.ci/format.sh

28 lines
481 B
Bash
Raw Normal View History

#!/usr/bin/env sh
2017-09-24 17:08:11 +03:00
# Runs the Clang Formatter
# Return codes:
# - 1 there are files to be formatted
# - 0 everything looks fine
set -eu
2017-09-24 17:08:11 +03:00
FILES=$(find src -type f -type f \( -iname "*.cpp" -o -iname "*.h" \))
2017-09-24 17:08:11 +03:00
for f in $FILES
do
2019-09-08 18:28:26 +03:00
clang-format -i "$f"
done;
2019-09-08 18:28:26 +03:00
2021-01-26 08:03:09 +03:00
QMLFORMAT_PATH=$(which qmlformat)
if [ ! -z "$QMLFORMAT_PATH" ]; then
QML_FILES=$(find resources -type f -iname "*.qml")
for f in $QML_FILES
do
qmlformat -i "$f"
done;
fi
2019-09-08 18:28:26 +03:00
git diff --exit-code