[libcxx-commits] [PATCH] D109835: [NFC][libc++] Update clang-format style.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 23 08:57:39 PDT 2021


ldionne added inline comments.


================
Comment at: libcxx/.clang-format:16
+IndentPPDirectives: AfterHash
+PPIndentWidth: 1
+
----------------
ldionne wrote:
> Mordante wrote:
> > ldionne wrote:
> > > Does this mean it'll always be only indented by one space? What we need is to indent it to tabs, whatever the size of tabs are in a given file. Is there a way to achieve that?
> > I assume you mean our standard indention of 2 spaces with "tabs". That would be achieved by removing this line, then it uses the default indention. I added this since you requested a one space indention D103368 and I've seen that indention used before in libc++.
> Sorry if we misunderstood each other -- what I want is for `#if`s to be indented consistently with the surrounding indentation, period. So if the surrounding indentation uses 4 tabs, nested preprocessor directives should look like:
> 
> ```
> #if CONDITION
> #   define FOO
>     ^ 5th column, i.e. indentation consists of 1x'#' and 3x' '
> #endif
> ```
> 
> Similarly, if surrounding indentation uses 2 spaces, then it should look like:
> 
> ```
> #if CONDITION
> # define FOO
>   ^ 3rd column, i.e. indentation consists of 1x'#' and 1x' '
> #endif
> ```
> 
> Does that make sense?
> So if the surrounding indentation uses ~~4 tabs~~ 4 spaces

(just to clarify what I meant)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109835



More information about the libcxx-commits mailing list