Commit Graph

3 Commits

Author SHA1 Message Date
Martin Hořeňovský
04382af4c6
Slightly better clang-format
Notably clang-format will no longer try to place template header
onto the same line as the function declaration.

Sadly it will still do it for attributes, because it took until
clang-format 16 for it to get the relevant option.
2023-01-05 23:02:51 +01:00
Martin Hořeňovský
fdea5a52c2
Improve the .clang-format file a bit
* add include sorting and grouping
* allow some short blocks to be on a single line
2022-11-07 23:14:29 +01:00
offa
273111d1a6
Clang-format configuration added.
Some notes on the configuration options chosen:

* We want `AllowShortEnumsOnASingleLine` set to `false`, but that
option is clang-format-11 and up, which is not out yet.
* `IndentPPDirectives` is currently inconsistent, but `AfterHash`
is the preferred style in new code.
* `NamespaceIndentation` is a mess, but `All` is closer to the effect
we want than `Inner`.
* `SpacesInParentheses` set to `true` is not ideal due to it also
introducing extra spaces in preprocessor expressions, but using it
is much closer to the current style than not.

All in all, using this setting globally would reformat pretty much
every line of code in the codebase, but it is as close as possible
to the bespoke style currently used. Still, it should only be used
on the diffs.

Closes #1182
2020-07-22 21:43:30 +02:00