-
Notifications
You must be signed in to change notification settings - Fork 562
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
clang-format #3499
Comments
Yeah this should happen. Whatever we do doesn't have to match the existing style perfectly or anything. I'd say aim to get to 90% to the existing format, just so the initial diff is not completely enormous, and then start enforcing formatting in CI, etc. Then we can start tweaking options to make the format more compact. |
After a bit of toying around with this, I'm quite pessimistic that this will ever converge to something without an enormous diff. 😞 Also, I feel, we should not try to iteratively change things in the clang-format configuration along the way. Each of those changes will again lead to large diffs and a barrier for back-porting. I would suggest we open a Draft PR where we try to converge on a style configuration by force-pushing iterations. And once we've converged, let's try to stick with what we defined. Here's a first suggestion as a starting point:
|
By the way (from our internal experience with This proved to be feasible and we don't see it as a show stopper. But it is an inconvenience that we keep in mind. |
Note that for checking the formatting in the CI we internally use the https://github.com/Sarcasm/run-clang-format helper. |
This isn't actually an issue because no matter what, That said since it seems like |
Opened a proposed format + formatting script in #3502 I'm not entirely happy with it, some parts clang-format definitely gets wrong and I can't figure out how to get it to do the right thing, but overall I can live with it. Currently that PR doesn't apply the changes. Run There are some further initial manual changes that I will make first to improve what clang-format spits out, along the lines of #3507, so that the final commit applying |
One thing to keep in mind: Currently, the examples have their own |
Are there any open issues with |
I need to mess with the config a bit more, but basically no. This will probably merge this week. |
Blocker: currently the Windows amalgamation build is failing, unclear what the problem is. |
I really have no idea what is happening here
https://github.com/randombit/botan/actions/runs/5079590438/jobs/9125517442?pr=3502 |
I could try locally in about an hour. Did some "workaround #define" go the way of the dodo? |
Fixed. |
#3502 has merged |
🎉 |
I think we all kind of agree that we want
clang-format
(#424, #2037 (comment), #2946 (comment)). Now with the 3.0.0 tag being the "tip of master": Let's have another go at this? 😀It apparently even supports Whitesmiths for some time (albeit I'm not sure how closely that resembles the current style). Frankly, when accepting the hazzle of a reformat, I guess moving to some more "commonly used style" would also make sense. I got used to Whitesmiths now, but I certainly remember having a fairly hard time parsing it at the beginnning. 😅
In any case: Having a CI job that ensures proper coding style from then on is probably also a good idea.
The text was updated successfully, but these errors were encountered: