How to format .mojom files?

115 views
Skip to first unread message

Chandan

unread,
May 26, 2017, 10:07:43 AM5/26/17
to chromium-mojo
Hi,

git cl format does not format .mojom files, like it does for .cc or .gn files.
Is some similar tool available to automatically format .mojom files?
How is it done generally?

Thanks in advance.

Ken Rockot

unread,
May 26, 2017, 10:14:27 AM5/26/17
to Chandan, chromium-mojo
We'd like to have presubmits and autoformatting, but it's not something we've had time for yet.

As a general rule, just follow the C++ formatting style, since the syntax is quite similar.


--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/48bc20db-5bac-40bf-b172-992787dcbba3%40chromium.org.

Dave Tapuska

unread,
May 26, 2017, 10:18:54 AM5/26/17
to Ken Rockot, Chandan, chromium-mojo
running "clang-format -i file" seems to work for me.

Chandan

unread,
May 26, 2017, 10:24:04 AM5/26/17
to chromium-mojo, roc...@chromium.org
This helps. Thanks.


On Friday, May 26, 2017 at 7:48:54 PM UTC+5:30, Dave Tapuska wrote:
running "clang-format -i file" seems to work for me.
On Fri, May 26, 2017 at 10:14 AM, Ken Rockot <roc...@chromium.org> wrote:
We'd like to have presubmits and autoformatting, but it's not something we've had time for yet.

As a general rule, just follow the C++ formatting style, since the syntax is quite similar.

On Fri, May 26, 2017 at 7:07 AM, Chandan <c.p...@samsung.com> wrote:
Hi,

git cl format does not format .mojom files, like it does for .cc or .gn files.
Is some similar tool available to automatically format .mojom files?
How is it done generally?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.

To post to this group, send email to chromi...@chromium.org.

Ken Rockot

unread,
May 26, 2017, 10:24:40 AM5/26/17
to Dave Tapuska, Chandan, chromium-mojo
That kind of works, but it doesn't understand the => operator, so it'll get that wrong.

Chandan

unread,
May 26, 2017, 10:27:29 AM5/26/17
to chromium-mojo, dtap...@chromium.org
Yes, it did get that operator wrong. Anyway thanks!


On Friday, May 26, 2017 at 7:54:40 PM UTC+5:30, Ken Rockot wrote:
That kind of works, but it doesn't understand the => operator, so it'll get that wrong.
On Fri, May 26, 2017 at 7:18 AM, Dave Tapuska <dtap...@chromium.org> wrote:
running "clang-format -i file" seems to work for me.
On Fri, May 26, 2017 at 10:14 AM, Ken Rockot <roc...@chromium.org> wrote:
We'd like to have presubmits and autoformatting, but it's not something we've had time for yet.

As a general rule, just follow the C++ formatting style, since the syntax is quite similar.

On Fri, May 26, 2017 at 7:07 AM, Chandan <c.p...@samsung.com> wrote:
Hi,

git cl format does not format .mojom files, like it does for .cc or .gn files.
Is some similar tool available to automatically format .mojom files?
How is it done generally?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.

To post to this group, send email to chromi...@chromium.org.

Ken Rockot

unread,
May 26, 2017, 10:28:11 AM5/26/17
to Dave Tapuska, Chandan, chromium-mojo
A quick test confirms that it also gets quite a few other things wrong, so if you're going to use clang-format (which I'm not sure you should), please be diligent in reviewing the formatting manually anyway.
Reply all
Reply to author
Forward
0 new messages