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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 06:50:56 PST 2019


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


================
Comment at: clang/unittests/Format/SortIncludesTest.cpp:132
+                 "#include <c>\n"
+                 "/* clang-format off */\n"
+                 "#include <b>\n"
----------------
alexfh wrote:
> 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?
You know i thought I was being so clever by not having the space after ..off to avoid

```
/*clang-format off*/
```

That'll teach me!


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

https://reviews.llvm.org/D58819





More information about the cfe-commits mailing list