RSS/Atom feed Twitter
Site is read-only, email is disabled

Line Lengths

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Line Lengths john smith 24 Dec 10:55
  CAGNS0RsjF2xTnpbAb_hhqN_0qF... 24 Dec 15:59
   1450972855764.1616594792@boxbe 25 Dec 10:48
    Line Lengths Joseph Bupe 25 Dec 07:51
   Line Lengths john smith 24 Dec 15:59
john smith
2015-12-24 10:55:30 UTC (almost 9 years ago)

Line Lengths

I had a read of https://github.com/GNOME/gimp/blob/master/HACKING but there is no mention of line length in the style guide.

This looks like it is roughly 80 https://github.com/GNOME/gimp/blob/master/app/menus/plug-in-menus.c

However, I can't help feeling that the code might be more readable with a slightly longer line length.

e.g https://github.com/GNOME/gimp/blob/master/app/menus/plug-in-menus.c#L162-L167 menu = g_strconcat (dgettext (locale_domain, path->data), "/", dgettext (locale_domain, plug_in_proc->menu_label), NULL);

Here we have a function that takes 4 parameters and has been wrapped. However, 2 of the parameters are inline functions and have been wrapped as well.

Wouldn't this be clearer with each parameter to the original function on its own line?:
menu = g_strconcat (dgettext (locale_domain,path->data), "/", dgettext (locale_domain,plug_in_proc->menu_label), NULL);

Is the code auto-formatted or done by hand?

john smith
2015-12-24 15:59:20 UTC (almost 9 years ago)

Line Lengths

On 24 December 2015 at 06:28, wrote:

On 24 December 2015 at 10:55, john smith wrote:

I had a read of https://github.com/GNOME/gimp/blob/master/HACKING but there is no mention of line length in the style guide.

GIMP uses a lightly modified GNU style, so 80 characters line length.

However, I can't help feeling that the code might be more readable with a slightly longer line length.

Perhaps! But it's all 80 and is very unlikely to be changed. If you submit a patch which breaks the 80 rule you'll probably be asked to reformat. Consistency trumps almost all other considerations in a large project.

Is the code auto-formatted or done by hand?

There's no auto format on commit.

There are lots of tools which can format GNU style, for example the standard "indent" filter defaults to GNU. It will sometimes mess up comment formatting though. Google have a very fancy code reformatter which might do a better job.

(I'm not actually a gimp dev, but that's my understanding of the situation, corrections pls.)

John

Fair enough.

Or http://www.commandlinefu.com/commands/view/6558/indent-all-the-files-in-a-project-using-emacs ....... :D

Joseph Bupe
2015-12-25 07:51:41 UTC (almost 9 years ago)

Line Lengths

I would be grateful to see this happen in Gimp.

On 24 December 2015 at 17:59, john smith wrote:

[image: Boxbe] john smith (
kingstonflat@gmail.com) is not on your Guest List

| Approve sender

| Approve domain

On 24 December 2015 at 06:28, wrote:

On 24 December 2015 at 10:55, john smith wrote:

I had a read of https://github.com/GNOME/gimp/blob/master/HACKING but there is no mention of line length in the style guide.

GIMP uses a lightly modified GNU style, so 80 characters line length.

However, I can't help feeling that the code might be more readable with a slightly longer line length.

Perhaps! But it's all 80 and is very unlikely to be changed. If you

submit a

patch which breaks the 80 rule you'll probably be asked to reformat. Consistency trumps almost all other considerations in a large project.

Is the code auto-formatted or done by hand?

There's no auto format on commit.

There are lots of tools which can format GNU style, for example the

standard

"indent" filter defaults to GNU. It will sometimes mess up comment formatting though. Google have a very fancy code reformatter which might

do

a better job.

(I'm not actually a gimp dev, but that's my understanding of the

situation,

corrections pls.)

John

Fair enough.

Or
http://www.commandlinefu.com/commands/view/6558/indent-all-the-files-in-a-project-using-emacs ....... :D
_______________________________________________ gimp-developer-list mailing list
List address: gimp-developer-list@gnome.org List membership:
https://mail.gnome.org/mailman/listinfo/gimp-developer-list List archives: https://mail.gnome.org/archives/gimp-developer-list

D/Insp. BUPE Joseph
*Data Protection Officer, INTERPOL NCB Lusaka*


*Zambia Police Service Headquarters,*
*Criminal Investigation Department,**P.O. Box 50104, Lusaka*
*Zambia*

*Officer Phone/Fax*: + 260 211 255218