· @mort
100 followers · 637 posts · Server fosstodon.org
· @mort
98 followers · 629 posts · Server fosstodon.org

It seems literally impossible to get to not align stuff.

Don't believe me? Take this piece of code and find a clang-format config which doesn't align stuff:

auto getWhateverStmt = db_.stmt(
"SELECT * FROM mytable "
"WHERE k = 2 "
"ORDER BY createdAt").bind();

Feel free to play with it in zed0.co.uk/clang-format-config. I literally can not find a way to make it not produce something absolutely ridiculous where the SQL is pushed all the way to the right.

#ClangFormat #llvm #cpp #c #programming

Last updated 1 year ago

Jim Ramsay · @lack
13 followers · 36 posts · Server fosstodon.org

Looking for a good language that will fit a specific existing codebase style.

I have a config that's *close* but I can't find a way to:
• have a different indent width for function definition continuation versus in-function continuation (16 spaces and 8 spaces, respectively)
• stop a static structure init from being collapsed to 1 line
• indent a nested struct init with block indent (8) and not continuation indent (16)

#c #formatter #ClangFormat

Last updated 2 years ago