On 28/01/14 13:08, Nicholas Nethercote wrote:
> On Tue, Jan 7, 2014 at 12:31 PM, Benjamin Smedberg
> <benja...@smedbergs.us> wrote:
>>
>> I am the owner of at least the C/C++ portions of the style guide; I propose
>> to wait and see whether the C++ reformatting tools are of sufficient quality
>> that we can use them directly, to avoid hand-reformatting, and make a final
>> decision next week sometime.

In my opinion clang-format is good enough.

>> In the meantime, we should wrap up the pending discussions about other
>> changes to the style guide, such as 80/100/infinite columns,
>> member/parameter/local naming convention, and other threads that Gavin was
>> going to start and one I'm going to start now ;-)
> 
> It's been a couple of weeks now. Can we move forward?

A style verifier would be nice.

> Anthony Jones has done some work on using clang-format to restyle
> lines that have changed in a file, but I don't think anyone has done
> any evaluation of clang-format for whole-file changes.

I haven't received any feedback either positive or negative in relation
to clang-format. That makes it hard for me to know whether to continue
putting any effort into improving it.

I've tested the whole file reformatting and it seems reasonable to me.
There are some cases it doesn't know anything about like the indenting
associated with macros such as NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN and
NS_IMPL_CYCLE_COLLECTION_UNLINK_END.

There is also some vagueness and inconsistency around:

bool
MyClass::MyFunction()

vs

bool MyClass::MyFunction()

Most of the code seems to do this only for top-level functions i.e. when
not already indented. I'd like some clarification on the rule here. It
seems to be applied differently in different parts of the code.

> I wonder if we could allow hand-reformatting (e.g.
> https://bugzilla.mozilla.org/show_bug.cgi?id=956199), at least for the
> moment? Because if we don't allow that, we're stuck in limbo until we
> decide on official guidelines for using automatic tools.

Right now with my modified clang-format-3.5 you can do:
$ ~/.mozbuild/clang-format-3.5 -i --style=Mozilla MyFile.cpp

Can we make bzexport automatically tag patches that have gone through
clang-format?

Anthony
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to