-
Notifications
You must be signed in to change notification settings - Fork 51
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
Use clang-format to format the whole codebase #278
Conversation
Signed-off-by: Steffen Vogel <[email protected]>
Signed-off-by: Steffen Vogel <[email protected]>
Signed-off-by: Steffen Vogel <[email protected]>
Signed-off-by: Steffen Vogel <[email protected]>
Signed-off-by: Steffen Vogel <[email protected]>
…previous mass changes of clang-format Signed-off-by: Steffen Vogel <[email protected]>
This results in a popup suggesting the installation of these extensions when the Devcontainer is opened in VS code. Signed-off-by: Steffen Vogel <[email protected]>
Signed-off-by: Steffen Vogel <[email protected]>
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
I think we will need to ignore the SonarCloud check in this instance as its merely a false positive. And the Windows build appears to be broken for other PRs as well? |
@stv0g it looks fine except for the Windows problem. The CI on the master does not seem to have this error related to spdlog: https://github.com/sogno-platform/dpsim/actions/runs/8049125560/job/21982389736?pr=278#step:3:867 |
Well, looks like @stv0g would probably be right, the last Looks like we need to update (finally) spdlog or add more warning supressing declarations in the CmakeList Lines 55 to 73 in e0ae9d9
Apparently are the following...
I guess that is something to be solved in a different issue and merged before this PR, or not? For Sonar, I agree that the code needs to be fixed at a different PR, not here. |
@leonardocarreras @stv0g If the Windows build is broken anyway, we can also merge this PR first and solve this issue in a separate PR later ;-) |
Following up on the clang-format discussion, I now have drafted a PR to reformat the whole code base using the clang-format tool with its LLVM preset. Please have a look at the LLVM coding standards for a description of this style.
This PR does:
.clang-format
configuration file for the project.git-blame-ignore-revs
file which hides the reformatting commit fromgit blame
and GitHubs blame web-viewscripts/format-all.sh
script to quickly reformat all C++ source and headers files of the project.devcontainer.json
to suggest installing a couple of extensions which are useful for DPsim-related C++ & Python developmentThis PR does NOT:
The idea I have is that we are tolerant towards violate the LLVM style for any commits as we want to keep the barrier for new contributors as low as possible. We dont want to drive them away because of failing nit-pick CI checks.
Hence, we only reformat the entire code-base from time to time by hand.
And of course:
I invite all regular contributors to install the clang-format VSCode extension, so your changes are directly properly formatted when a file is saved.
(Btw. this also speeds up our own coding a lot as you will not have to worry ever again about code formatting. Just write as you like, save the file and everything is tidy :D)