Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions run-clang-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ def list_files(files, recursive=False, extensions=None, exclude=None):
if ext in extensions:
out.append(f)
else:
out.append(file)
isAddFile = True

for pattern in exclude:
if fnmatch.fnmatch(file, pattern):
isAddFile = False
break

if isAddFile:
out.append(file)
return out


Expand Down Expand Up @@ -130,7 +138,7 @@ def run_clang_format_diff(args, file):
original = f.readlines()
except IOError as exc:
raise DiffError(str(exc))

if args.in_place:
invocation = [args.clang_format_executable, '-i', file]
else:
Expand Down