Introduce clang-format + make the CI enforce clang-format clean C/C++ code#260
Introduce clang-format + make the CI enforce clang-format clean C/C++ code#260
Conversation
This is with clang-format 15.0.7.
ba9fa7e to
116298a
Compare
|
@hartwork I would prefer to apply this first to Core only, extracting as much of the pre-existing style into the formatter configuration as possible. The configuration should focus on enforcing consistency instead of re-styling the existing code. |
@kaixiong why only fix it in half the code?
We can do that. If you can make a list of "bugs" in the effect, I can see if I can find the knows to turn for it.
Re-styling was never the key missing, it is a side-effect of the current inconsistency and in that sense a necessity, just the degree of it depends on the config. |
|
@hartwork Plugins that are imported code (actors mostly) come with their own formatting. Some are internally consistent, some are not. What's more, we mostly modify them just to fix bugs so I do not find the need for formatting fixes strong enough to mess up the blame history. Large patches like the one for DancingParticles are not common. I'm okay with applying Core's formatting to the others (input and morph). |
@kaixiong is my understanding correct that actors starting from existing multi-file code would then not be discussed regarding whitespace except avoiding unnecessary changes in whitespace (since they are noise in diffs) and that we would auto-format all actor code that started in here just like core — would that be the deal? |
@kaixiong the idea is this:
.clang-formatwith the default formatting and then track changes to that file over time in Git..clang-formatstyle choices until ideally the pain of everyone is low enough is part of what the pull request.clang-format <[email protected]>so it stands out in e.g. Git blame.Looking forward to your feedback.