[SUGGESTION] add .clang-format file to repo #647
Replies: 3 comments 3 replies
-
This is the whole of the suggestion. Manual formatting is also resource-consuming. I remember when I first discovered it. |
Beta Was this translation helpful? Give feedback.
-
If we were to adopt a .clang-format, does anybody have one at hand we can base it on? Last time I set up one for my projects it took me a while to get it exactly how I like it (going through all the possible flags in the clang-format doc is a bit tedious). I think if we aim for one, it should minimize diff with the code that is currently on main branch, otherwise the |
Beta Was this translation helpful? Give feedback.
-
@JohelEGP You created this clang-format for Cpp2 (thanks again!). Should we add that to the repo? |
Beta Was this translation helpful? Give feedback.
-
DISCLAIMERS TO SET EXPECTATIONS: I'm generally against language feature requests/changes unless they can be shown to improve simplicity, safety, or toolability in a quantifiable way. So:
:
for every declaration and only for declarations.Will your feature suggestion eliminate X% of security vulnerabilities of a given kind in current C++ code? If yes, please be specific about the classes of bugs that would go away, with an example or two (especially a link to a real CVE or two).
Will your feature suggestion automate or eliminate X% of current C++ guidance literature? If yes, please be specific about what current good guidance this helps make the default, and/or what guidelines we would no longer need to teach/learn or that would be simplified and how, with an example or two (especially a link to a real "Effective C++" or "C++ Core Guidelines" guideline or two). For ideas, you can refer to my CppCon 2020 talk starting at 10:31 where I summarize a categorized breakdown based on over 600 C++ guidance literature rules I cataloged and analyzed.
Describe alternatives you've considered.
There's nearly always more than one way to improve something. What other options did you consider? Why is the one you're suggesting better than those?
manual formating - human error prone, clang-format is widely used and do not force to use it
Beta Was this translation helpful? Give feedback.
All reactions