[cfe-dev] [clang-format] Indentation of preprocessor directives
Curdeius Curdeius via cfe-dev
cfe-dev at lists.llvm.org
Tue Aug 30 07:49:08 PDT 2016
I've written a working draft for a new clang-format option
"PPDirectiveIndentation" (available at
Basically, it indents preprocessor directives. So, the code
# define A
when PPDirectiveIndentation = All.
So far, there are only two options (None, All), but I foresee another
option Inner or something like that to mimic the behaviour of
The number of spaces between '#' and the directive name is controlled by
IndentWidth option (to be consistent with indentation inside namespaces,
classes, blocks etc.), but it may be easily modified.
What's the interest in it? Among well known source code that indents
preprocessor directives, there are many Boost libraries (a quick search
What are the chances that it gets merged?
I'll submit the code for revision to Phabricator this week when I find some
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev