Skip to content

Instantly share code, notes, and snippets.

@k4rtik
Created July 6, 2016 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k4rtik/a4019186ac5e54852449e245a206960a to your computer and use it in GitHub Desktop.
Save k4rtik/a4019186ac5e54852449e245a206960a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# note: clang-tidy only accepts one file at a time, but we can run it
# parallel against disjoint collections at once.
find . \( -name \*.c -or -name \*.cpp -or -name \*.cc -or -name \*.h \) | xargs -n1 -P4 cleanup-tidy
# clang-format accepts multiple files during one run, but let's limit it to 12
# here so we (hopefully) avoid excessive memory usage.
find . \( -name \*.c -or -name \*.cpp -or -name \*.cc -or -name \*.h \) | xargs -n12 -P4 cleanup-format -i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment