--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CABiQX1VQ9vySMu3_Vng-eGs3jHpjOtzQFc3K7iff1kfcK%2By%2BPQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHtyhaTFDad-nrhf7eYmJaos4v0Kc2ZeKnxt11Nv%2BnLEHtpzMQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEoffTCnBEAOJdESCYFze89W%2BbrrOr7xT7buQjJyuD39oig%2ByQ%40mail.gmail.com.
You said: 'Yeah, the problem here is that it relies on clang-format being present in the "normal" location for this to work. But, `git-cl format` by itself works for non-chromium-src repos as well, and might not have that binary.''it' probably means 'running clang-format on js files'.`git cl format` is able to run clang-format on cc files. Behind the scenes, I think this finds clang-format in the chromium tree. So I think this only works for chromium (unless you set CHROMIUM_BUILDTOOLS_PATH).
So shouldn't it be possible to make that Just Work for .js files too? Or does `git cl format --js` do more than just run clang-format?
On Thu, Feb 3, 2022 at 4:08 PM Nico Weber <tha...@chromium.org> wrote:You said: 'Yeah, the problem here is that it relies on clang-format being present in the "normal" location for this to work. But, `git-cl format` by itself works for non-chromium-src repos as well, and might not have that binary.''it' probably means 'running clang-format on js files'.`git cl format` is able to run clang-format on cc files. Behind the scenes, I think this finds clang-format in the chromium tree. So I think this only works for chromium (unless you set CHROMIUM_BUILDTOOLS_PATH).Right.So shouldn't it be possible to make that Just Work for .js files too? Or does `git cl format --js` do more than just run clang-format?I think it depends on what you mean by "just work". We could probably make it format JS without needing any command line switches in Chromium, but it doesn't do so currently.Obviously, we could define some mechanism that would allow things to work correctly for arbitrary repos, but we haven't yet.Does that get closer to what you were talking about?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGbLiF91JU2__bE5Ke601ZPU3zY9%2B20R0wmuZWoEd8H3ShuEQ%40mail.gmail.com.
So the argument is that non-chromium repos have quite a bit of js, but almost no c++?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGbLiEPXtOC5ML2mdq_ZkFg5J_rL%3DHaJC0FPik074Qi5j97Cw%40mail.gmail.com.
The only thing "git cl format --js" does is add ".js" and ".ts" to the list of files clang-format will process:
The only advantages I can see to leaving out --js right now:1. Save some CPU cycles by not formatting JavaScript/TypeScript files.2. Don't mess with JavaScript/TypeScript files that aren't clang-formatted already.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CACwGi-5n4_fLRCWW4GhNfxraLDyTjMC9kv6NmDXNHH0dxSHNpQ%40mail.gmail.com.