[PATCH] D33932: [clang-format] Add support for case-insensitive header matching and use it to improve support for LLVM-style include sorting.

Chandler Carruth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 03:56:13 PDT 2017


chandlerc created this revision.
Herald added subscribers: mcrosier, sanjoy, klimek.

This really is a collection of improvements to the rules for LLVM
include sorting:

- We have gmock headers now, so it adds support for those to one of the categories.
- LLVM does use 'FooTest.cpp' files to test 'Foo.h' so it adds that suffix for finding a main header.
- At times the test file's case may not match the header file's case, so adds support for case-insensitive regex matching of these things.

With this set of changes, I can't spot any misbehaviors when re-sorting
all of LLVM's unittest '#include' lines.

Note that I don't know the first thing about testing clang-format, so please
feel free to tell me what all I need to be doing here.


https://reviews.llvm.org/D33932

Files:
  include/clang/Format/Format.h
  lib/Format/Format.cpp
  unittests/Format/SortIncludesTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33932.101535.patch
Type: text/x-patch
Size: 4790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170606/1f3d3ff2/attachment.bin>


More information about the cfe-commits mailing list