-
Notifications
You must be signed in to change notification settings - Fork 10
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
Formating tools #33
Comments
tool: clang format Online tool to configure the style: https://zed0.co.uk/clang-format-configurator/# |
Let me bring up this discussion and push the usage of #32.
IMO the most important question is, "Should we stop relaying on the nice template rules to be able to use clang format?" The goal should be that we come soon to a automated formation because we have more and more distributed developer and a hand full projects with different styles. @sbastrakov @ax3l @jkelling @SimeonEhrig @bernhardmgruber @BenjaminW3 @bertwesarg @j-stephan @ComputationalRadiationPhysics/alpaka-developers @ComputationalRadiationPhysics/picongpu-developers Please answer the question: |
IMO yes we should. Reasons are:
|
Yes. I already proposed one for alpaka. |
I think that would make a lot of sense. |
Yes. |
Yes, we should use an automated formatting tool and clang-format seems to be the dominant choice here. As for the guidelines that cannot be enforced using clang-format: you can still keep them and apply them once clang-format supports the corresponding options. In the interim, we could mark the rules as "currently not enforceable but we wish we could have it". |
By default my Emacs runs clang-format after each save, so: Yes |
We have to keep in mind that we do not only agree on a specific set of clang-format rules but also on the specific clang-format version because each version produces slightly different results and newer versions support more features. I would vote for clang-format 10 😉 |
I also think we should be using clang-format. |
I agree! |
As a sidenote: the template formatting proposed by the style guide seemed fairly easy to implement in clang-format. Here is a diff: llvm/llvm-project@master...bernhardmgruber:format |
If you can add an option in clang format for that and push a PR to clang/llvm it would be wonderful. Until it goes mainline we can aggree on e.g. clang-format 10. |
Sounds nice, go for it :) |
Carrying over the discussion from #19 to here. clang-format appears to be relatively easy, I don't think we need to patch the LLVM source code for that. However we will also require clang-tidy because clang-format doesn't handle stuff like While working on the clang-tidy file I also noticed a huge load of additional options that (to me) appear immensely useful but are not really style-related. I suggest the following procedure:
Of course all PRs will be up for debate. In the end we should have a nice style / best practices guide along with the means to actually enforce the rules. And it appears that CMake actually has builtin support for (at least) clang-tidy, so that is nice, too. |
Nice plan of action @j-stephan ! |
Here you can add tools those help to format the source code.
The goal is that we find a formatting tool to automate the formation.
The text was updated successfully, but these errors were encountered: