* Proposal for GNU indent compatibility
@ 2009-06-19 16:37 Pavel Roskin
2009-06-19 17:01 ` Vladimir 'phcoder' Serbinenko
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Pavel Roskin @ 2009-06-19 16:37 UTC (permalink / raw)
To: grub-devel
Hello!
In order to encourage developers to use proper indentation on the newly
added code, I suggest that we accept the default style of GNU indent.
That is, the space after "!" should not be needed. That's the only
difference I'm aware of.
Running indent on the code and then adding spaces after "!" is
ridiculous, in my opinion. GRUB and indent are both GNU programs, it
should not be needed to do such things.
That doesn't mean that we should start reformatting the existing code.
Neither does it mean that it's acceptable to submit code that GNU indent
failed to format nicely.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Proposal for GNU indent compatibility
2009-06-19 16:37 Proposal for GNU indent compatibility Pavel Roskin
@ 2009-06-19 17:01 ` Vladimir 'phcoder' Serbinenko
2009-06-19 21:52 ` Pavel Roskin
2009-06-21 11:25 ` Robert Millan
2009-07-31 8:03 ` Marco Gerards
2 siblings, 1 reply; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-19 17:01 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]
On Fri, Jun 19, 2009 at 6:37 PM, Pavel Roskin <proski@gnu.org> wrote:
> Hello!
>
> In order to encourage developers to use proper indentation on the newly
> added code, I suggest that we accept the default style of GNU indent.
I agree with proposition
>
> That is, the space after "!" should not be needed. That's the only
> difference I'm aware of.
>
I ran indent on whole codebase. It failed on ./lib/LzmaDec.c and
./script/lua/lvm.c and issued warnings on ./script/lua/ldump.c and
./script/lua/lundump.c
It made following changes.
1) Cut long lines. Not always in a sensible place
2) Added a space before parenthesis in __attribute__ ((...))
3) Put newlines after ^L, not around
4) Removed space after !
5) Fixed spaces
6) Added spaces before comment if comment shares a line with code
7) Merged short lines in arguments
8) Removed spaces before labels
9) Added a space after &
10) in initializations like
a = {
..
};
it has put { on new line and without spacing
Perhaps something more. The patch would be 77280 lines. If someone there
would be a way to check indent doen't introduce bugs we could run it
sometimes on all .c files.
>
> Running indent on the code and then adding spaces after "!" is
> ridiculous, in my opinion. GRUB and indent are both GNU programs, it
> should not be needed to do such things.
>
> That doesn't mean that we should start reformatting the existing code.
> Neither does it mean that it's acceptable to submit code that GNU indent
> failed to format nicely.
>
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
[-- Attachment #2: Type: text/html, Size: 2749 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Proposal for GNU indent compatibility
2009-06-19 17:01 ` Vladimir 'phcoder' Serbinenko
@ 2009-06-19 21:52 ` Pavel Roskin
0 siblings, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2009-06-19 21:52 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, 2009-06-19 at 19:01 +0200, Vladimir 'phcoder' Serbinenko wrote:
> 8) Removed spaces before labels
Oh, I missed that. I think we should follow GNU indent in the label
placement as well.
> it has put { on new line and without spacing
> Perhaps something more. The patch would be 77280 lines. If someone
> there would be a way to check indent doen't introduce bugs we could
> run it sometimes on all .c files.
I'm sure it doesn't introduce bugs, but it can mangle some code.
My point is that we should accept the code processed by GNU indent
without any additional changes unless GNU indent obviously mangles the
code. There should be no coding conventions that GNU indent doesn't
follow.
I don't think we need to reindent everything.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Proposal for GNU indent compatibility
2009-06-19 16:37 Proposal for GNU indent compatibility Pavel Roskin
2009-06-19 17:01 ` Vladimir 'phcoder' Serbinenko
@ 2009-06-21 11:25 ` Robert Millan
2009-06-21 11:41 ` Alfred M. Szmidt
2009-07-31 8:03 ` Marco Gerards
2 siblings, 1 reply; 6+ messages in thread
From: Robert Millan @ 2009-06-21 11:25 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, Jun 19, 2009 at 12:37:20PM -0400, Pavel Roskin wrote:
> Hello!
>
> In order to encourage developers to use proper indentation on the newly
> added code, I suggest that we accept the default style of GNU indent.
> That is, the space after "!" should not be needed. That's the only
> difference I'm aware of.
What does GCS say about spaces after "!"?
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Proposal for GNU indent compatibility
2009-06-21 11:25 ` Robert Millan
@ 2009-06-21 11:41 ` Alfred M. Szmidt
0 siblings, 0 replies; 6+ messages in thread
From: Alfred M. Szmidt @ 2009-06-21 11:41 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: grub-devel
> In order to encourage developers to use proper indentation on the
> newly added code, I suggest that we accept the default style of
> GNU indent. That is, the space after "!" should not be needed.
> That's the only difference I'm aware of.
What does GCS say about spaces after "!"?
It doesn't say anything on the topic. But it has a single example
relating to gnulib where there is a space used after !.
| #include "error.h"
| #include <errno.h>
| #include <stdio.h>
| char *program_name = "myprogram";
| FILE *
| xfopen (char const *name)
| {
| FILE *fp = fopen (name, "r");
| if (! fp)
| error (1, errno, "cannot read %s", name);
| return fp;
| }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Proposal for GNU indent compatibility
2009-06-19 16:37 Proposal for GNU indent compatibility Pavel Roskin
2009-06-19 17:01 ` Vladimir 'phcoder' Serbinenko
2009-06-21 11:25 ` Robert Millan
@ 2009-07-31 8:03 ` Marco Gerards
2 siblings, 0 replies; 6+ messages in thread
From: Marco Gerards @ 2009-07-31 8:03 UTC (permalink / raw)
To: The development of GRUB 2
Hi,
Pavel Roskin <proski@gnu.org> writes:
> In order to encourage developers to use proper indentation on the newly
> added code, I suggest that we accept the default style of GNU indent.
> That is, the space after "!" should not be needed. That's the only
> difference I'm aware of.
>
> Running indent on the code and then adding spaces after "!" is
> ridiculous, in my opinion. GRUB and indent are both GNU programs, it
> should not be needed to do such things.
>
> That doesn't mean that we should start reformatting the existing code.
> Neither does it mean that it's acceptable to submit code that GNU indent
> failed to format nicely.
I do not have a problem with this. Thus the space change around "!".
--
Marco
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-31 8:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-19 16:37 Proposal for GNU indent compatibility Pavel Roskin
2009-06-19 17:01 ` Vladimir 'phcoder' Serbinenko
2009-06-19 21:52 ` Pavel Roskin
2009-06-21 11:25 ` Robert Millan
2009-06-21 11:41 ` Alfred M. Szmidt
2009-07-31 8:03 ` Marco Gerards
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.