[PATCH] D58819: [clang-format] clang-format off/on not respected when using C Style comments

Alexander Kornienko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 06:09:39 PST 2019


alexfh added inline comments.


================
Comment at: clang/unittests/Format/SortIncludesTest.cpp:132
+                 "#include <c>\n"
+                 "/* clang-format off */\n"
+                 "#include <b>\n"
----------------
Add a test with `/* clang-format officially supports C++ */` ;)

Seriously speaking, the `startswith()` condition in the code should be a bit stricter. Maybe just compare with `/* clang-format off */` and `/* clang-format on */`? If there's a motivating use case for just checking the prefix, could you add it to the test?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58819/new/

https://reviews.llvm.org/D58819





More information about the llvm-commits mailing list