mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-12-20 08:12:01 +03:00
14 lines
463 B
Bash
Executable File
14 lines
463 B
Bash
Executable File
#!/bin/bash
|
|
for FILE in $(git diff --cached --name-only)
|
|
do
|
|
if [[ "$FILE" =~ src/[A-Za-z0-9\ \-]+*\.(c|h|cpp|cc)$ ]]; then
|
|
echo Autoformatting $FILE with clang-format
|
|
clang-format-11 -style=file -i -- $FILE
|
|
git add -- $FILE
|
|
elif [[ "$FILE" =~ src/(components|displayapp|drivers|heartratetask|logging|systemtask)/.*\.(c|h|cpp|cc)$ ]]; then
|
|
echo Autoformatting $FILE with clang-format
|
|
clang-format-11 -style=file -i -- $FILE
|
|
git add -- $FILE
|
|
fi
|
|
done
|