[PATCH] D37136: [clang-format] Do not format likely xml

2017-08-29 Thread Krasimir Georgiev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311999: [clang-format] Do not format likely xml (authored by krasimir). Changed prior to commit: https://reviews.llvm.org/D37136?vs=113085&id=113087#toc Repository: rL LLVM https://reviews.llvm.org/

[PATCH] D37136: [clang-format] Do not format likely xml

2017-08-29 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir updated this revision to Diff 113085. krasimir marked 3 inline comments as done. krasimir added a comment. - Address review comments https://reviews.llvm.org/D37136 Files: lib/Format/Format.cpp unittests/Format/FormatTest.cpp unittests/Format/SortIncludesTest.cpp Index: unittes

[PATCH] D37136: [clang-format] Do not format likely xml

2017-08-29 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Just a few minor comments, otherwise looks good. Comment at: lib/Format/Format.cpp:1542 +bool likelyXml(StringRef Code) { + return Code.ltrim().startswith("<");

[PATCH] D37136: [clang-format] Do not format likely xml

2017-08-25 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir created this revision. Herald added a subscriber: klimek. This patch detects the leading '<' in likely xml files and stops formatting in that case. A recent use of a Qt xml file with a .ts extension triggered this: http://doc.qt.io/qt-4.8/linguist-ts-file-format.html https://reviews.llv