heads-up: code-review bot's clang-format message changing

2021-03-10 Thread Frederik Braun
Hi all, You can stop reading, if you have a setup that never requires you to applying clang-format manually. (Aside: For those that eagerly want to belong to this group, but don't yet, I suggest you look into `./mach ide`.) For all those who get the clang-format warning from code-review bo

Re: precedence of Mozilla, Google, and clang-format styles for C++ code

2019-07-23 Thread Ehsan Akhgari
h are the guidelines that should apply only > > to older code? > > > > "we are not aiming to enforce any naming conventions at this time" > > [1] but both the Google and Mozilla style guides have > > (conflicting) naming conventions. Can we clarify which, i

Re: precedence of Mozilla, Google, and clang-format styles for C++ code

2019-07-23 Thread Ehsan Akhgari
ing this in large projects that adopt the Google C++ Style (e.g. the Chromium C++ Style https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md ). > The other piece of the equation here is [1] > > our precise coding style will be the result of formatting our >

Re: precedence of Mozilla, Google, and clang-format styles for C++ code

2019-07-23 Thread Bryce Seager van Dyk
an we distinguish which are the guidelines that should apply only > to older code? > > "we are not aiming to enforce any naming conventions at this time" > [1] but both the Google and Mozilla style guides have > (conflicting) naming conventions. Can we clarify which, if any,

precedence of Mozilla, Google, and clang-format styles for C++ code

2019-07-21 Thread Karl Tomlinson
uidelines apply to new and older code? The other piece of the equation here is [1] > our precise coding style will be the result of formatting our > tree with clang-format, so by definition our code, when > formatted with clang-format, will be following our new coding > style. clang-

hg/git hooks for clang-format

2019-03-25 Thread Sylvestre Ledru
We have now clang format hooks/extension for hg and git. Both work in the same way: at commit phase, they will automatically run "mach clang-format <https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_C++_Code_With_clang-format>" (which is

Re: Proposal to adjust our clang-format rules to include spaces after the hash for nested preprocessor directives

2019-01-17 Thread Ehsan Akhgari
27;d like to propose the first modification to our clang-format rules based > on the feedback I've received since the switch to our new coding style from > the SpiderMonkey team. > > The problem we're trying to solve is that in code that has nested > preprocessor directives,

Re: Proposal to adjust our clang-format rules to include spaces after the hash for nested preprocessor directives

2019-01-12 Thread Gabriele Svelto
On 11/01/19 02:01, Ehsan Akhgari wrote: > The common way to deal with this problem is to indent nested preprocessor > directives, very much similarly to how we indent normal code, for example: > > #if foo > # if bar > #define x 1 > # else > #define x 2 > # endif > #endif this would be

Re: Proposal to adjust our clang-format rules to include spaces after the hash for nested preprocessor directives

2019-01-10 Thread Kris Maglione
This has been my preferred style for a long time, but lately clang-format just throws it away whenever I try to do it. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Proposal to adjust our clang-format rules to include spaces after the hash for nested preprocessor directives

2019-01-10 Thread Ehsan Akhgari
Hi everyone, I'd like to propose the first modification to our clang-format rules based on the feedback I've received since the switch to our new coding style from the SpiderMonkey team. The problem we're trying to solve is that in code that has nested preprocessor direc

Re: What is future of editor mode-lines after the switch to clang-format?

2018-12-10 Thread Gregory Szorc
On Wed, Dec 5, 2018 at 5:51 AM Ehsan Akhgari wrote: > On Fri, Nov 30, 2018 at 8:23 PM Ehsan Akhgari > wrote: > >> On Fri, Nov 30, 2018 at 4:08 PM Gregory Szorc wrote: >> >>> On Fri, Nov 30, 2018 at 10:00 AM wrote: >>> >>> > Now that all of m

Re: What is future of editor mode-lines after the switch to clang-format?

2018-12-05 Thread Ehsan Akhgari
On Fri, Nov 30, 2018 at 8:23 PM Ehsan Akhgari wrote: > On Fri, Nov 30, 2018 at 4:08 PM Gregory Szorc wrote: > >> On Fri, Nov 30, 2018 at 10:00 AM wrote: >> >> > Now that all of mozilla-central is been migrated to use clang-format >> > automated code for

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Ehsan Akhgari
On Fri, Nov 30, 2018 at 4:08 PM Gregory Szorc wrote: > On Fri, Nov 30, 2018 at 10:00 AM wrote: > > > Now that all of mozilla-central is been migrated to use clang-format > > automated code formatting, the question of what should happen with editor > > modelines at th

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Ehsan Akhgari
On Fri, Nov 30, 2018 at 2:06 PM Nathan Froyd wrote: > On Fri, Nov 30, 2018 at 1:51 PM Ehsan Akhgari > wrote: > > I think these are all great points. It seems like for Emacs, it is not > > actually necessary to sprinkle modelines across all of the files in your > > repository (per https://bugzil

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Mike Hommey
On Fri, Nov 30, 2018 at 09:57:00AM -0800, tcampb...@mozilla.com wrote: > Now that all of mozilla-central is been migrated to use clang-format > automated code formatting, the question of what should happen with editor > modelines at the top of files should be considered. &

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Gregory Szorc
On Fri, Nov 30, 2018 at 10:00 AM wrote: > Now that all of mozilla-central is been migrated to use clang-format > automated code formatting, the question of what should happen with editor > modelines at the top of files should be considered. > > https://bugzilla.mozilla.org/show_b

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Tom Tromey
Nathan> Unfortunately, it doesn't look like .dir-locals.el provides any way to Nathan> set file modes, e.g. setting python-mode for moz.build file That's correct, it's a hole in dir-locals (there's already a bug filed against Emacs for this). It's also easy to document how to update auto-mode-ali

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Nathan Froyd
On Fri, Nov 30, 2018 at 1:51 PM Ehsan Akhgari wrote: > I think these are all great points. It seems like for Emacs, it is not > actually necessary to sprinkle modelines across all of the files in your > repository (per https://bugzilla.mozilla.org/show_bug.cgi?id=1023839#c7). > For Vim, Benjamin

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Andrew McCreight
On Fri, Nov 30, 2018 at 10:00 AM wrote: > Now that all of mozilla-central is been migrated to use clang-format > automated code formatting, the question of what should happen with editor > modelines at the top of files should be considered. > > https://bugzilla.mozilla.org/show_b

Re: What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread Ehsan Akhgari
On Fri, Nov 30, 2018 at 1:00 PM wrote: > Now that all of mozilla-central is been migrated to use clang-format > automated code formatting, the question of what should happen with editor > modelines at the top of files should be considered. > > https://bugzilla.mozilla.org/show_b

What is future of editor mode-lines after the switch to clang-format?

2018-11-30 Thread tcampbell
Now that all of mozilla-central is been migrated to use clang-format automated code formatting, the question of what should happen with editor modelines at the top of files should be considered. https://bugzilla.mozilla.org/show_bug.cgi?id=clang-format Here are some options and some arguments

Re: Follow up on clang-format

2017-09-29 Thread Jeff Gilbert
Now instead we will get to try to phrase code in a way that clang-format will preserve readably? I should think "it doesn't always produce nice formatting, but it's at least consistent" sounds like a major warning sign, particularly given that we definitely have tricky code fo

Re: Follow up on clang-format

2017-09-29 Thread Sylvestre Ledru
Le 28/09/2017 à 23:21, Randell Jesup a écrit : >> On Thursday, September 28, 2017 at 10:15:05 AM UTC+2, Chris Pearce wrote: >> Oh d'oh! Looks like I replied to an old thread, and the plan now is in fact >> to clang-format the entire tree after 57. Sweet as! > Where di

Re: Follow up on clang-format

2017-09-28 Thread Randell Jesup
>On Thursday, September 28, 2017 at 10:15:05 AM UTC+2, Chris Pearce wrote: >Oh d'oh! Looks like I replied to an old thread, and the plan now is in fact >to clang-format the entire tree after 57. Sweet as! Where did you find that? Was this plan communicated? It's not in th

Re: Follow up on clang-format

2017-09-28 Thread Chris Pearce
On Thursday, September 28, 2017 at 10:15:05 AM UTC+2, Chris Pearce wrote: > On Friday, May 23, 2014 at 3:29:48 AM UTC+2, Anthony Jones wrote: > > Some of you may remember the discussion on clang-format and the `mach > > clang-format` command. What we have in place right now is

Re: Follow up on clang-format

2017-09-28 Thread Chris Pearce
On Friday, May 23, 2014 at 3:29:48 AM UTC+2, Anthony Jones wrote: > Some of you may remember the discussion on clang-format and the `mach > clang-format` command. What we have in place right now is very temporary > but it is functional enough to give it a try. I have not put the effo

Re: Follow up on clang-format

2017-09-26 Thread Martin Thomson
On Wed, Sep 27, 2017 at 7:34 AM, Mike Hommey wrote: > And then you end up with something like: > > class Foo { > Type MethodA() { do_something(); } > Type MethodB() > { > do_something_that_happens_to_be_long_enough_not_to_fit_on_the_same_line(); > } > Type MethodC() { do_something_el

Re: Follow up on clang-format

2017-09-26 Thread Martin Thomson
On Tue, Sep 26, 2017 at 10:49 PM, Sylvestre Ledru wrote: >> clang-format messes up really badly many macros. >> For example nsElementTable.cpp becomes unreadable. > > Yeah, for this kind of structure & presentation layout, we should just ignore the formatting on the

Re: Follow up on clang-format

2017-09-26 Thread Mike Hommey
On Tue, Sep 26, 2017 at 02:49:56PM +0200, Sylvestre Ledru wrote: > Le 26/09/2017 à 14:33, smaug a écrit : > > On 05/23/2014 04:29 AM, Anthony Jones wrote: > >> Some of you may remember the discussion on clang-format and the `mach > >> clang-format` command. What we have

Re: Follow up on clang-format

2017-09-26 Thread Sylvestre Ledru
Le 26/09/2017 à 14:33, smaug a écrit : > On 05/23/2014 04:29 AM, Anthony Jones wrote: >> Some of you may remember the discussion on clang-format and the `mach >> clang-format` command. What we have in place right now is very temporary >> but it is functional enough to give it

Re: Follow up on clang-format

2017-09-26 Thread smaug
On 05/23/2014 04:29 AM, Anthony Jones wrote: Some of you may remember the discussion on clang-format and the `mach clang-format` command. What we have in place right now is very temporary but it is functional enough to give it a try. I have not put the effort into upstreaming my changes

Re: Follow up on clang-format

2014-06-26 Thread Sylvestre Ledru
On 22/05/2014 18:29, Anthony Jones wrote: > Some of you may remember the discussion on clang-format and the `mach > clang-format` command. What we have in place right now is very temporary > but it is functional enough to give it a try. I have not put the effort > into upstreamin

Re: Follow up on clang-format

2014-05-23 Thread Kartikaya Gupta
I tried using clang-format on entire files and I noticed two things (there might be others, I didn't look too closely): 1) When it reformats comments to fit in the line length, it just inserts linebreaks rather than rewrapping the text. So you end up with text like this, where the last c

Follow up on clang-format

2014-05-22 Thread Anthony Jones
Some of you may remember the discussion on clang-format and the `mach clang-format` command. What we have in place right now is very temporary but it is functional enough to give it a try. I have not put the effort into upstreaming my changes. Depending on the feedback I receive I will either

Re: clang-format

2014-01-22 Thread Anthony Jones
On 23/01/14 15:26, Gregory Szorc wrote: > As a temporary workaround until upstream gets patched, we're > downloading and running hosted binaries from ajone's people account > (with consent of course). He hasn't built the binary for OS X yet. I've created bug 962954 to track this issue. Anthony __

Re: clang-format

2014-01-22 Thread Gregory Szorc
952379 has landed on m-c so you can now use the work flow below: >> >> $ hg qrefresh >> $ mach clang-format >> >> This reformats only the lines that are different from tip^. It doesn't >> show anything on the console. Review the changes with your favourite >

Re: clang-format

2014-01-22 Thread Bobby Holley
n now use the work flow below: > > $ hg qrefresh > $ mach clang-format > > This reformats only the lines that are different from tip^. It doesn't > show anything on the console. Review the changes with your favourite > diff tool. You can see a beautiful screenshot here: &g

Re: clang-format

2014-01-22 Thread Anthony Jones
Excuse the continued conversation with myself. Bug 952379 has landed on m-c so you can now use the work flow below: $ hg qrefresh $ mach clang-format This reformats only the lines that are different from tip^. It doesn't show anything on the console. Review the changes with your favo

Re: clang-format

2014-01-08 Thread Anthony Jones
clang-format-3.5 is now available for Windows using the updated patch in bug 952379. Anthony On 08/01/14 15:31, Anthony Jones wrote: > I have been doing some testing with clang-format and formatting only the > lines that have been modified. > > Version 3.5 is good enough for M

clang-format

2014-01-07 Thread Anthony Jones
I have been doing some testing with clang-format and formatting only the lines that have been modified. Version 3.5 is good enough for Mozilla style although the defaults for style=Mozilla need to be corrected. It doesn't handle weird cases like NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN and

Re: clang-format

2013-05-05 Thread Mike Hommey
On Sun, May 05, 2013 at 04:04:44PM -0400, Ehsan Akhgari wrote: > clang-format is a source code formatting tool developed by Google which can > do automatic whitespace cleanup, vertical alignment and line breaking > changes to C++ code. See this video [1] for a recent presentation about &

clang-format

2013-05-05 Thread Ehsan Akhgari
clang-format is a source code formatting tool developed by Google which can do automatic whitespace cleanup, vertical alignment and line breaking changes to C++ code. See this video [1] for a recent presentation about the tool in the LLVM Developers Conference (the slides are here [2]). And it