Import .clang-format from InfiniTime and format sources#191
Import .clang-format from InfiniTime and format sources#191NeroBurner merged 1 commit intoInfiniTimeOrg:mainfrom
Conversation
This should be a non-change from a compiler's perspective.
|
Thanks! How do I invoke clang format? and can I have a followup PR with a clang format check job in CI? pretty please 😁 |
|
|
found a one-liner in bash to run on whole project (works thanks to your clang ignore file\ # when in InfiniSim root dir
find . -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i |
|
I put in some more elbow grease and increased the runtime to basically instant: created the script To run on just one specific file just pass the file to the script In the end a short number of changed lines will be shown #!/bin/bash
set -e
if [[ "$1" == "" ]]; then
find . -type d \
\( -path ./InfiniTime \
-o -path "./*build*" \
-o -path "./sim/nrfx" \
-o -path "./sim/libraries" \
-o -path "./sim/host" \
-o -path "./external" \
\) \
-prune -o -iname '*.h' -o -iname '*.cpp' -exec clang-format -i {} +
else
clang-format -i "$@"
fi
git diff --ignore-submodules --stat |
This should be a non-change from a compiler's perspective.