Re: Script to format the functions in a C header?

2016-11-29 Thread Sébastien Wilmet
On Sun, Nov 20, 2016 at 11:44:41AM +0100, Lasse Schuirmann wrote: > Shouldn't this be like totally easy with GNU Indent or so? You'll have > to give it the right CLI args. (We have a wrapper for that in coala if > you're interested in doing loads of other stuff but indent is usually > already

Re: Script to format the functions in a C header?

2016-11-29 Thread Lasse Schuirmann
> Ok, thanks, I can look at clang-format if it supports the GNOME/GTK+ > convention for formatting function prototypes in a header. > > Otherwise I can write a new script, and re-use some code from > lineup-parameters: > https://github.com/swilmet/gnome-c-utils > (it's based on regexes, so it's

Re: Script to format the functions in a C header?

2016-11-29 Thread Lasse Schuirmann
Shouldn't this be like totally easy with GNU Indent or so? You'll have to give it the right CLI args. (We have a wrapper for that in coala if you're interested in doing loads of other stuff but indent is usually already there.) Sincerely, Lasse Schuirmann la...@schuirmann.net http://coala.io/ -

Re: Script to format the functions in a C header?

2016-11-23 Thread Christian Hergert
On 11/23/2016 05:03 AM, Sébastien Wilmet wrote: Also, in the GNOME convention there is something that I don't like and that I would prefer not to do: aligning all the parameter names on the same column (the third column). I prefer aligning the parameter names for each function separately, IMHO

Re: Script to format the functions in a C header?

2016-11-23 Thread Christian Hergert
On 11/23/2016 05:38 AM, Leslie S Satenstein via desktop-devel-list wrote: Can someone tell me what is wrong with using the *indent* program? indent does not fully support our style, nor does it align groups of functions to add space so functions are aligned as a group.

Re: Script to format the functions in a C header?

2016-11-23 Thread Leslie S Satenstein via desktop-devel-list
Can someone tell me what is wrong with using the indent program?man indent for detailsSummary The indent program can be used to make code easier to read.  It can also convert from one style of writing C to another.    indent understands a substantial amount about the syntax of C, but it

Re: Script to format the functions in a C header?

2016-11-23 Thread Sébastien Wilmet
On Tue, Nov 22, 2016 at 07:03:02PM +0100, Daiki Ueno wrote: > For what it's worth, I wrote such elisp some time ago: > http://elpa.gnu.org/packages/gnome-c-style.html Cool, added to: https://wiki.gnome.org/Newcomers/Tools-C-language > If anyone is trying to implement the feature somewhere, I

Re: Script to format the functions in a C header?

2016-11-21 Thread Christian Hergert
On 11/21/2016 11:01 AM, Sébastien Wilmet wrote: Ok, thanks, I can look at clang-format if it supports the GNOME/GTK+ convention for formatting function prototypes in a header. Last I tried clang-format it couldn't format our reference alignment rules in function prototypes. Uncrustify could

Re: Script to format the functions in a C header?

2016-11-21 Thread Sébastien Wilmet
On Mon, Nov 21, 2016 at 03:49:09PM +, Ikey Doherty wrote: > You could use clang-format and an appropriately configured > .clang-format file to enforce coding convention within a source > tree. > > I'd recommend checking: https://clangformat.com/ as a simple way > to build your .clang-format >

Re: Script to format the functions in a C header?

2016-11-21 Thread Ikey Doherty
You could use clang-format and an appropriately configured .clang-format file to enforce coding convention within a source tree. I'd recommend checking: https://clangformat.com/ as a simple way to build your .clang-format I tend to keep an "update_format.sh" script in my repos to ensure

Script to format the functions in a C header?

2016-11-20 Thread Sébastien Wilmet
Hi, Is there a script to format the function prototypes in a C header, with the GNOME conventions? I.e. aligning the function names on the same column, aligning the parameters, etc. Thanks, Sébastien ___ desktop-devel-list mailing list