prime/tools/clang-format.sh

16 lines
255 B
Bash
Raw Normal View History

#!/bin/bash -e
function add_newline {
if [[ -z "$(tail -c 1 "$1")" ]]; then
:
else
echo >> "$1"
fi
}
2022-09-18 06:05:46 +00:00
FILES=$(git ls-files -c "*.h" "*.hpp" "*.c" "*.cpp")
clang-format -i ${FILES}
for f in ${FILES}; do
add_newline $f
2022-09-18 06:05:46 +00:00
done