-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clang-format to check and format code #118
Conversation
This will close #96. |
@ktbolt, ready for your review. Conveniently, the only manually modified files are the four ones at the top. All other formatting was done by |
@mrp089 There are only a few style options that should be followed for the code to have a uniform appearance and to be readable. Let's just enforce the style options outlined in the Coding Standards section https://github.com/SimVascular/svFSIplus/blob/main/Documentation/pages/implementation.md into clang_format. You can write out the Google options file and modify that. |
@ktbolt, can you comment on what specific changes you want to make? I think the current style agrees with what is defined in Coding Standards. Within this pull request, you can go to |
@ktbolt, can you please re-review? Thanks! |
@ktbolt, if you don't have any more format changes, can you please finish the review so we can merge? Thank you! |
Looking at some the material model formatting I see things like
and there is
which is converted to
If I was checking statements like these for errors I would probably first reformat them to group terms and such. There are lots of hideous statements like these in the code and the formatting just makes it worse. In the next version of the svFSIplus code I hope to add some clarity to the likes of these but this is what we have now. This is why I suggested not bothering with formatting with this version in the first place. |
Agreed, the formatted version doesn't look great here, and neither does the original I still think it makes sense to set uniform formatting standards (and others defined in GitHub Actions) now so people get used to it, and we don't have to deal with formatting in pull requests. Plus, developers will add new code for which we can already enforce the new standard. |
Breaking up or converting complex statements to loops is a waste of time and could introduce errors into a working code. In the next stage of development we will strive for a cleaner implementation of material models and the like. We can then add format checking. For the current code we will not use clang-format check. |
Not ready to merge yet. I added tools to format and check the code. The integration test should fail on
ubuntu-22.04
.If that works, I'll add the actual re-formatting commit modifying all
.h
and.cpp
files to theGoogle C++
format. I will exclude this pull request after its merge fromgit blame
by adding a.git-blame-ignore-revs
file in a second pull request.