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:
If true, aligns trailing comments.
int a; // My comment a vs. int a; // My comment a
int b = 2; // comment b int b = 2; // comment about b
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.
int a, int b, int c, int d, int e);
void myFunction(int a,
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…