summaryrefslogtreecommitdiff
path: root/utils/sort_includes.py
Commit message (Collapse)AuthorAge
* Teach sort_includes.py to drop duplicated includes.Benjamin Kramer2012-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170911 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the include sorter to quickly skip files with an extension thatChandler Carruth2012-12-04
| | | | | | | | doesn't look like it will have C++ code in it. Suggestions on a better heuristic are welcome. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169248 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the include sorter to skip files under test trees and under INPUTSChandler Carruth2012-12-04
| | | | | | | 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
* Teach the include sorting script about the gtest headers; sort them withChandler Carruth2012-12-04
| | | | | | the system headers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169242 91177308-0d34-0410-b5e6-96231b3b80d8
* Address review comments from Matt on the sort_includes.py script.Chandler Carruth2012-12-04
| | | | | | | | | | | | | | | 1) Teach it to handle files with #include on the first line -- these do actually exist in LLVM. 2) Support llvm-c and clang-c include projects. 3) Nuke some stail imports. 4) Switch to using os.path to split the file extension off. 5) Remove debugging leftovers. 6) Add docstring (a really puny one) for the sort function. I'm continuing te avoid stripping the whitespace on the RHS to preserve whatever newline characters happen to be in the original file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169222 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the include sorter to not choke on include guards. ;]Chandler Carruth2012-12-03
| | | | | | | Kind of important when prepping the include/... tree version of the sort changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169132 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a completely hack-ish tool to sort includes according to the codingChandler Carruth2012-12-03
standards. I am a terrible Python programmer. Patches more the welcome. Please tell me how this should look if it should look differently. It's just a tiny little script so it didn't make sense to go through pre-commit review, especially as someone who actually knows python may want to just rip it apart and do it The Right Way. I will be preparing a commit shortly that uses this script to canonicalize *all* of the #include lines in LLVM. Really, all of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169125 91177308-0d34-0410-b5e6-96231b3b80d8