Skip to content

Instantly share code, notes, and snippets.

@RyanKung
Created May 10, 2018 06:11
Show Gist options
  • Save RyanKung/44c4d7b6ce2a8b745316fb10ebe08a4e to your computer and use it in GitHub Desktop.
Save RyanKung/44c4d7b6ce2a8b745316fb10ebe08a4e to your computer and use it in GitHub Desktop.
C/Cpp code refiner
def refine(args, path, filenames):
for filename in filenames:
if filename.split('.')[-1] in ['c', 'h', 'cpp', 'hpp']:
target = "%s/%s" % (path, filename)
print('fefine %s' % target)
os.system('clang-format -i -style=LLVM %s' % target)
os.path.walk('./', refine, ())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment