[cfe-dev] Clang-format on specific lines: absolute indentation

Arnaud Coomans via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 19 16:40:11 PDT 2018


(Note: I’m a LLVM/clang newbie)

I’m trying to tackle a bug about indentation in clang-format for when formatting should be done on certain lines only  (https://bugs.llvm.org/show_bug.cgi?id=37975 <https://bugs.llvm.org/show_bug.cgi?id=37975>).

What’s the expected behavior? One could expect:
- absolute indentation: the indentation one would get if the whole file were formatted; or
- relative indentation: keep the indentation relative to the previous lines, even if those are not indented correctly and are not in the range of lines to format

Judging from the tests, the relative indentation has been adopted; but I could see both cases being valid.

Are we ok with relative indentation by default?
Would we be ok to add a new parameter to specify absolute indentation?

Any opinion/advice?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180719/a9c64c88/attachment.html>

More information about the cfe-dev mailing list