Draft: Add .clang-format file

Open Denis Kasak requested to merge wip-clang-format into master

Our current C and C++ coding styles are not very uniform and we don't seem to be following any particular standard, even though there are some patterns we more-or-less abide by. It would be nice if we could rely on a tool to automatically ensure that code is formatted uniformly.

As a first step towards this goal, this MR attempts to reproduce our current style using clang-format. However, it still introduces quite a lot of changes since clang-format doesn't yet support dangling parentheses (where the closing parenthesis of a parameter list goes on its own line). Due to this, it's probably not yet ready for a merge, but I'm opening a MR to discuss/keep track of it.

Another option would be to abandon our current style and going with one of the more common standards (perhaps tweaking a few options).

Merge request reports