Source Code Formatting with clang-format

Code should be understandable. To be able to understand code, it must be readable. In order to be readable, it must be properly formatted.

We use a tool called clang-format to reformat code, which applies the style defined in .clang-format. Starting with PR#291, continuous integration will check modified files for proper formatting. The intent is to slowly get the whole project formatted without too much inconvenience.

Please run clang-format on all .C, *.cpp, *.cxx, and *.h files touched in your commit. Use to check if your commit is acceptable before submitting your pull request. The formatting can be applied manually to change the file in-place:

clang-format -i file.cxx

You can exclude code by using "// clang-format off" and "// clang-format off" where the automatic produces sub-optimal results. For example each *LinkDef.h file should have // clang-format off at the top.

There are also tools to integrate it into all reasonable editors and IDEs, e.g.:

- Clion
- VisualStudio Code
- Sublime Text
- Vim