If the clang-format on/off is in a /* comment */ then the sorting of headers is not ignored
djasper klimek JonasToth krasimir alexfh
- rC355266: [clang-format] clang-format off/on not respected when using C Style comments
rL355266: [clang-format] clang-format off/on not respected when using C Style comments
rG9b468c0b1e3f: [clang-format] clang-format off/on not respected when using C Style comments
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?
Should we allow
/* clang-format off It is just horrible for this piece of code. */
? Multiline-comments could span multiple lines and to deactivates clang-format and give reasons.
initially that is kind of what I was trying to do, but if you look over in TokenLexer where its turned off for styling they check only for a single line
So to be honest if we are going to change it we should change it in both places, but perhaps that is just overkill.