Skip to content

Add .clang-format file.

Daan De Meyer requested to merge (removed):clang-format into master

See: https://mail.kde.org/pipermail/kwrite-devel/2019-August/005247.html

Initial take at a .clang-format file. Tried this configuration out on a few files and didn't seem to drastically change stuff.

Of course, I don't mind at all what the final style is so feel free to test it out and make changes as needed. I've used clang-format before and I'm moderately familiar with its style options so I can help with figuring out the configuration given an example of how a particular piece of code should be formatted. I've enabled commits from maintainers so you can modify the clang-format branch in my fork with any changes (according to gitlab).

The list of options can be found here: https://releases.llvm.org/5.0.2/tools/clang/docs/ClangFormatStyleOptions.html.

I've linked the clang 5 options to avoid using options only available in the latest release but this does raise the issue of how we deal with different clang-format versions producing different output. Should we require code to be formatted with the latest clang-format version? That might not be ideal for developers on non-rolling release distros.

Edited by Christoph Cullmann

Merge request reports