Perform auto formatting with microsofts auto formatter on the three e…#2308
Perform auto formatting with microsofts auto formatter on the three e…#2308
Conversation
|
@Lomholy could you please remove "irrelevant"/non-related parts of the PR checkboxes? In the current form I think it very unclear what the point of your PR is? (As a sidenote I am inclined to support less rather than more dependency on MS tech these days...) |
|
@willend I updated the PR and added some information. I think it may be important to note that i half intend this PR as a short discussion on using a formatter or not. |
|
Hi again @Lomholy - thanks for improving the PR info. Maybe open a separate discussion item? (IMHO better for a longer exchange than a PR is) |
|
@willend Separate discussion has now been opened :D |
|
@Lomholy thanks. Vacation this week, will participate in discussion after. |
Free-form text area
Please describe what your PR is adding in terms of features or bugfixes:
This PR proposes to use an established auto formatter for C code, and then applying said formatter in components.
This is of course only possible by treating each different section (TRACE SHARE etc.) as its own little C code.
I propose this in order to improve the readability of the larger components after multiple people with different editors have changed indenting and therefore arrive at inconsistent indenting.
I do not have a strong opinion of which formatter to use, nor which style to set it to. What is important to me, is to make it easy to have a properly indented code to work on.
For this PR I initially used the formatter bundled with the Visual Studio code extension C/C++ from microsoft which is the clang-format tool.
A brief google search indicates that Astyle is another option, if we want something that is not heavily supported by apple or microsoft.
Examples of the microsoft formatter applied to code is in this pull request the Monochromator_bent.comp, Monochromator_bent_complex.comp and Union_mesh.comp.
My contribution contains something else