mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-03 05:53:52 +00:00
Updating clang format pre-commit helper example
[skip ci]
This commit is contained in:
parent
df5b157d97
commit
b519a13119
@ -9,9 +9,14 @@ format_file() {
|
||||
file="${1}"
|
||||
case "$file" in
|
||||
*.hpp | *.cpp | .c | *.cc | *.cu | *.h )
|
||||
echo "Fixing: $file"
|
||||
clang-format -i -style=file "${1}"
|
||||
echo "Formatting: $file"
|
||||
clang-format -i -style=file -sort-includes "${1}"
|
||||
if git diff-file --quiet -- "${1}" ; then
|
||||
git add "${1}"
|
||||
echo "Reformatting file: ${1}"
|
||||
else
|
||||
echo "Already formatted: ${1}"
|
||||
fi;
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user