Add .clang-format configuration file#51
Conversation
|
Excellent! I was considering doing this, but you were first.
|
|
This is not about "totally breaks your coding style". But I like the bare, unconfigured clang style better.
|
I'll admit, I stole the style from QT, and made a few changes as the bare style for C++ made some stuff totally incomprehensible to me. :)
I prefer braces thusly:
Agreed, not sure exactly how to put the commas at the end of the previous line.
Agreed, this puts system includes before local includes. This PR was put here expressly to get the teams thoughts and make any changes first. Don't want to have to apply multiple mega merges. :) |
|
I prefer the but its not of much importance, so we can have the braces your way. (Depending on what others say, if anything.) |
I'm not worried. As long as the conversion can be done with a tool on the push of a button, the whole thing isn't a big deal. Plan A is to do the conversion in a moment when there are no PRs. One of several possible plans B is to shrug shoulders, draw a deep breath, do the conversion on the main branch and also on the PR branch, catch the delta in a patchfile, and get the PR branch going afresh from the main branch's head via the patchfile. If there's a problem, I'm willing to offer help. |
|
I took a closer look. Please add at the top of the file, so people know where to find the documentation. I think the funny comma thing is repaired by The include sorting is together with I'm also a bit afraid the clang-format would ruin our documentation comments unless we say In the past, we had a mixture of different line endings, partly in the same file. To not have that happen again: |
|
For all changes I would like to see, including less important ones, run the following through |
That also works. Originally it was doing a single line if it could do it in a 80 char width, ie if(badabing){some really long code}else{some more code} |
ReflowComments says to use IndentOnly explicitly for doxygen and ascii art
|
Ok, give that a whirl. Turns out there is a fix for the ReflowComments, but only if you have clang 19+, which I don't. |
|
This can merge whenever. |
I had suggested to make But as we basically do not use |
|
I rebased this, squashed the several commits into one, added a "." to the initial commit comment. I took the source and re-formatted it via and confirmed everything still compiles and the resulting program still runs. I pushed the rebased branch to our main branch. One step further towards more consistent coding. Thanks, @wmiler ! |
This is just for testing!!! Uses clang-format-18.
Please give it a whirl, and let me know if this totally breaks your coding style. One note, and something I didn't even know was in the c++ standards was the use of apostrophes in large numbers (from c++14).