Teach the include sorter to skip files under test trees and under INPUTS
authorChandler Carruth <chandlerc@gmail.com>
Tue, 4 Dec 2012 09:59:54 +0000 (09:59 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 4 Dec 2012 09:59:54 +0000 (09:59 +0000)
trees. This allows running the input sorter on the entire clang
repository cleanly now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169247 91177308-0d34-0410-b5e6-96231b3b80d8

utils/sort_includes.py

index 855cb38ad594c4f5829a6f2512c8c3037d966931..c1500f52e043958d9945d506bf620c91a25ca39a 100755 (executable)
@@ -13,6 +13,11 @@ import os
 
 def sort_includes(f):
   """Sort the #include lines of a specific file."""
+
+  # Skip files which are under INPUTS trees or test trees.
+  if 'INPUTS/' in f.name or 'test/' in f.name:
+    return
+
   lines = f.readlines()
   look_for_api_header = os.path.splitext(f.name)[1] == '.cpp'
   found_headers = False