[PATCH] D42395: [clang-format] Fix bug where -dump-config failed on ObjC header

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 25 09:30:56 PST 2018


benhamilton marked an inline comment as done.
benhamilton added inline comments.


================
Comment at: test/Format/lit.local.cfg:2-3
+# Suffixes supported by clang-format.
+config.suffixes = ['.cpp', '.h', '.m', '.mm', '.java', '.js', '.ts', '.proto',
+                   '.protodevel', '.pb.txt', '.textproto', '.asciipb', '.td']
----------------
jolesiak wrote:
> Where does this list come from?
> Shouldn't '.textpb', 'METADATA', '.c', '.cc' be added here?
It's a good question, thanks.

I copied this list from LibFormat's getLanguageByFileName():

https://github.com/llvm-mirror/clang/blob/master/lib/Format/Format.cpp#L2265

I did miss .textpb, added now. I also added .c and .cc since they should default to C++ style.

METADATA isn't a suffix understood by clang-format, so I did not add it.



Repository:
  rC Clang

https://reviews.llvm.org/D42395





More information about the cfe-commits mailing list