Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
34 lines (27 sloc) 956 Bytes
#!/usr/bin/env python
from __future__ import print_function
import fnmatch
import os
import subprocess
import sys
import glob
path = os.path.dirname(os.path.realpath(__file__))
masks = ['*.hpp', '*.h', '*.cpp', '*.c', '*.cxx']
ignore = ['build/*', 'build-*', 'cmake-*', '.*', 'include/kfr/io/dr']
filenames = []
for root, dirnames, files in os.walk(path, path):
ignore_dir = False
for mask in ignore:
if fnmatch.fnmatch(os.path.relpath(root, path), mask):
ignore_dir = True
if not ignore_dir:
for mask in masks:
for filename in fnmatch.filter(files, mask):
filenames.append(os.path.join(root, filename))
for filename in filenames:
print( filename, '...' )['clang-format', '-i', filename])
# Fix clang-format bug:
for tmp_file in glob.glob(filename+'*.tmp'):