Clang format documentation as .clang-format

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Clang format documentation as .clang-format

Oleg Smolsky via cfe-dev
Hi all,

Yesterday I was (manually) going through all the clang format options and crafting a format file for our organisation. While doing that I wondered: wouldn't it be great if the documentation of clang-format was actually a .clang-format file!

I.e. the docs could be a simple as:

AlignTrailingComments: false

# If true, aligns trailing comments.
# true:                                   false:
# int a;     // My comment a      vs.     int a; // My comment a
# int b = 2; // comment  b                int b = 2; // comment about b

AllowAllParametersOfDeclarationOnNextLine: true

# If the function declaration doesn’t fit on a line, allow putting all parameters of a function 
# declaration onto the next line even if BinPackParameters is false.
#
# true:
# void myFunction(
#     int a, int b, int c, int d, int e);
# false:
# void myFunction(int a,
#                 int b,
#                 int c,
#                 int d,
#                 int e);

I understand this isn't markdown, but this would tremendously improve the ease of making your "own" clang-format specs.

Right now are some websites which help you with this:
But neither supports v8, for example, nor do they contain the actual docs of the functions...

Greetings,

Bram

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev