On 1/5/2014 9:34 PM, Nicholas Nethercote wrote:


   I propose that we officially remove this implicit discouragement, and even
   encourage changes that convert non-Mozilla-style code to Mozilla-style (with
   some exceptions; see below). When modifying badly-styled code, following
   existing style is still probably best.
I don't think that style changes are currently actively forbidden, but they aren't exactly encouraged. What you're primarily changing is whether they are encouraged.

I think that there are two important rules here:

* Real patches shouldn't mess with coding style
* Style changes should be coordinated with the module owner to minimize conflicts with other patches that are in progress or planned.

Karl suggests in the thread that we should discourage reformatting which moves code to a different line, which would appear to include braces. I disagree, since bracing changes and whitespace formatting are the most important issues for scanning code, and we should fix them all at once.

What's not clear to me from the discussion is whether there is a reformatting tool which already exists which can do what we need. If there is, I think we should actively discourage people reformatting by hand, and just encourage people to use the tool at an appropriate time.



- There is an semi-official policy that the owner of a module can dictate its
   style. Examples: SpiderMonkey, Storage, MFBT.
Spidermonkey is hard because it uses a different member naming convention and so the changes are potentially much more invasive. But I at least support starting out by unifying the indentation and bracing styles across the tree, and removing other exceptions.

   Also, we probably shouldn't change the style of imported third-party code;
Yes.

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 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 ;-)

--BDS

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

Reply via email to