Created
August 10, 2017 05:23
-
-
Save whatot/41203b561fd13ddfde3796893d2ec26f to your computer and use it in GitHub Desktop.
use clang-format to format all c/c++ files based on Google style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -ue | |
| PROJECT_ROOT=$(readlink -m "$(dirname "$(readlink -f "$0")")"/../) | |
| echo "processing ${PROJECT_ROOT} ..." | |
| find "${PROJECT_ROOT}" -type f \ | |
| -regextype posix-egrep -regex ".*\.(h|hpp|cpp|cc)$" -print0 | \ | |
| xargs -0 clang-format -style="{BasedOnStyle: Google, IndentWidth: 4}" -i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment