Skip to content

Instantly share code, notes, and snippets.

@domfarolino
Last active December 3, 2022 18:53
Show Gist options
  • Save domfarolino/8492f28115cda11e7be4ab3f1484e8a7 to your computer and use it in GitHub Desktop.
Save domfarolino/8492f28115cda11e7be4ab3f1484e8a7 to your computer and use it in GitHub Desktop.
clang-format on all C++ files in a directory
find . -maxdepth 20 -name \*.cc -not -path "./bazel*" -exec clang-format -i --style=Chromium {} > file \;
find . -maxdepth 20 -name \*.h -not -path "./bazel*" -exec clang-format -i --style=Chromium {} > file \;
# From https://stackoverflow.com/questions/28896909/
# find $PWD/base -type f \( -name "*.h" -o -name "*.cpp" \) -exec clang-format -style=Chromium --dry-run --Werror {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment