Add code style templates for CLion and clang-format.
I just thought it would be nice to have something to begin with: I like the idea of having one standardized way the code should be formatted throughout the project. However, how exactly it would be formatted at the end can and probably should still be discussed. The nice thing is, you can just change these settings and click "reformat", so it will not be an issue to update code later on.
At first I tried to base these settings on the existing code as much as I could. Then I ran into problems with the CLion formatter and switched to clang-format. clang-format, however, only provides a few base templates with limited support for customization.
Please have a look if those settings are ok for you and feel free to change them at will (but probably always discuss it with @johannesugb first)
Also: You never have to use those even if they are committed! Feel free to use them or not. I did not add style sheets for Visual Studio yet, and this would be a nice addition.
@ifl0w or @JolifantoBambla, are you interested in reviewing this PR?
I do not want to discuss code formatting here as it is a very opinionated topic and simply should be defined by the main contributors.
That being said, a .clang-format is a good way to encourage some basic code styles IMO, and I think it is a good idea to add one. I'd only remove the comment in the first line.
The style itself most likely originates from the author's IDE and is considerably different from the one used in this project. A project-wide re-formatting with clang-format should be included in this PR for completeness and also to better review and discuss the styles used.
I would not add the clion_format_style.xml styling as that suggests a preferred IDE (should be up to the programmer) and it seems to only describe styles for the language Objective-C but I am not familiar with how CLion interprets this file.
I totally agree with @ifl0w.
I'd drop the clion_format_style.xml, stick to .clang-format, and let the main contributors decide on a code style.
I would not add the clion_format_style.xml styling as that suggests a preferred IDE (should be up to the programmer) and it seems to only describe styles for the language Objective-C but I am not familiar with how CLion interprets this file.
I'd drop the clion_format_style.xml, stick to .clang-format, and let the main contributors decide on a code style.
Thank you for you input! I agree with you. We should drop the CLion format and stick to one, more neutral template, and clang-format is IDE-agnostic, which is favorable. (The CLion formatter also has some bugs (some of them would ignore the settings and format the code in an unexpected way) which I did not know at the time of writing the template [0])
The style itself most likely originates from the author's IDE and is considerably different from the one used in this project.
I will check again at time to stick to the current style of the project.
... simply should be defined by the main contributors. ... let the main contributors decide on a code style.
If there is anything which should be different from the current project style in the template, please let me know.