GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — [WIP] tools: use clang-format to format C++ code by joyeecheung · Pull Request #16122 · nodejs/node Conversation
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Should this be applied to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, and test/addons and test/addons-napi as well. The problem of course is that it results in humongous diffs. It:
That might be a good solution, because
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
641f51b to
6969062
Compare
|
@danbev @bnoordhuis Just noticed I have missed
I think we can try to relax the rules a bit and make them more about capturing what we have right now, then tighten the rules one by one later, so there will be less conflicts to start with. Basically by doing
That I've described in the OP. I will try to tweak with it a bit, maybe after #16090 lands.
Yeah the npm module does keep track of the revision of its binaries. Also we can do something like what |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Did a bit of archaeology and found #1539 , let's see if clang-format is flexible enough to do this kind of stuff again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
#16090 has already landed. Will try to tweak the .clang-format over the weekend. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
From an LTS/backporting perspective if we're going to do this I'd rather do it all at once, and backport it ASAP, rather than the "death by a thousand cuts" style of making changes. I assume that's better for open Pull Requests too. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@gibfahn hmm now come to think of it, I think this one can be backported by running the final clang-format on all branches instead of manually backporting them? Also for conflicts in other PRs we can do that as well, so it might not be that hard... I will give this another try over the weekend |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Initializes .clang-format - Add `make format` to Makefile
6969062 to
ab13553
Compare
There was an error while loading. Please reload this page.
|
BTW: I am still pursuing this. One outstanding issue is when is appropriate for this to land, if it ever gets landed. Any patches to C++ code landed prior to this patch would not land cleanly anymore, even when this patch is backported to different release lines asap, and the conflict would look pretty scary. To land those C++ changes one has to manually recreate the commits by copying files via |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@joyeecheung http://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting - can be used to reformat commits when applying them. The CI can probably be made to do it automatically when rebasing onto the target branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bnoordhuis Ooh, that looks pretty nice! Thanks for discovering that. I'll see if I can integrate it somehow. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@joyeecheung is this something you still work on? I believe it would still be great to have something like this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
FWIW, I still think it's a good idea and the practical issues are tractable. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@BridgeAR I have not forgotten about this, just need to find some time to tweak this again... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
If I'm not mistaken, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closed in favor of #21997 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.