Here's what I've done for the last few projects I've been on: * Taken the off-the-shelf formatter. * Taken the default configuration. * Applied that frequently. * Moved on to more important things.
I understand the desire to come to some sort of consensus on what code should look like. It's a massive time sink and the marginal utility over the above doesn't justify the expenditure of time. At some point, all those cases where the whitespace or alignment annoyed your sensibilities stops bothering you and you begin to appreciate the time you saved. ----- Original Message ----- From: "Bobby Holley" <bobbyhol...@gmail.com> To: "Martin Thomson" <m...@mozilla.com> Cc: "Till Schneidereit" <t...@tillschneidereit.net>, "Mike Hommey" <m...@glandium.org>, "Ehsan Akhgari" <ehsan.akhg...@gmail.com>, dev-platform@lists.mozilla.org, "Andrea Marchesini" <amarches...@mozilla.com> Sent: Thursday, December 19, 2013 9:28:07 AM Subject: Re: style guide proposal Off-the-shelf automated tools are not going to solve our formatting woes. Both the JS engine and Gecko mandate very particular patterns. I ended up writing a custom python tool to reformat XPConnect a few years ago [1] because none of the tools were configurable enough. I think detailed style guides are hugely important, because developers have a spec to code to, and don't have to try to read the reviewer's mind. In SpiderMonkey, there's been a push to document the outcome of every style discussion in the style guide. The SM style guide now has a lot of detail on how these edge cases should be handled (see [2]), and I find it very helpful. On this issue specifically - email seems to be garbling the alignment of the proposals (at least for me). Can anyone with a proposal (baku, Ms2ger) resend it as a pastebin? [1] https://bugzilla.mozilla.org/show_bug.cgi?id=688012 [2] https://wiki.mozilla.org/JavaScript:SpiderMonkey:C_Coding_Style#Other_whitespace On Thu, Dec 19, 2013 at 8:33 AM, Martin Thomson <m...@mozilla.com> wrote: > If we are talking about checking (a separate thing, in my opinion), then > we should be talking about linting :) Checking for formatting is probably > less useful than something more concrete. Having run jshint over some of > the code, I was horrified at the output it produced. > > That said, checking formatting in general is a massive waste of time. If > we had an automated tool, then I could notice a problem, then say "did you > run {clang-format,astyle,js-beautify}", but generally not worry about > formatting. > > ----- Original Message ----- > From: "Till Schneidereit" <t...@tillschneidereit.net> > To: "Ehsan Akhgari" <ehsan.akhg...@gmail.com> > Cc: "Mike Hommey" <m...@glandium.org>, dev-platform@lists.mozilla.org, > "Andrea Marchesini" <amarches...@mozilla.com> > Sent: Thursday, December 19, 2013 8:11:39 AM > Subject: Re: style guide proposal > > [...] > > I think we should increase the checking we do, and make it a habit to run > the checks before try-servering or putting a patch up for review. It's > really not a good investment of anyone's time to have to deal with trailing > whitespace during a review. > > [1]: > > http://mxr.mozilla.org/mozilla-central/source/js/src/config/check_spidermonkey_style.py > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform