* [PATCH] Coding guideline for Error messages @ 2014-06-16 12:55 Philip Oakley 2014-06-16 12:55 ` [PATCH] doc: State coding guideline for error message punctuation Philip Oakley 0 siblings, 1 reply; 8+ messages in thread From: Philip Oakley @ 2014-06-16 12:55 UTC (permalink / raw) To: GitList; +Cc: Jeff King A recent review comment highlighted the current view on error message punctuation. I thought it worth recording. In the past I've also seen guidance on the error message style. This patch also gives a place for recording such guidance, for example, ensuring that the message is useful to the user, rather than referring to some internal technical issue. I haven't looked deeply for those yet. Philip Oakley (1): doc: State coding guideline for error message punctuation Documentation/CodingGuidelines | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.9.4.msysgit.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] doc: State coding guideline for error message punctuation 2014-06-16 12:55 [PATCH] Coding guideline for Error messages Philip Oakley @ 2014-06-16 12:55 ` Philip Oakley 2014-06-16 18:52 ` Junio C Hamano 2014-06-17 9:37 ` Jeff King 0 siblings, 2 replies; 8+ messages in thread From: Philip Oakley @ 2014-06-16 12:55 UTC (permalink / raw) To: GitList; +Cc: Jeff King Clarify error message puntuation to reduce review workload [1]. [1] http://article.gmane.org/gmane.comp.version-control.git/251547 (see trailing 'nit' item). Signed-off-by: Philip Oakley <philipoakley@iee.org> --- Documentation/CodingGuidelines | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 4d90c77..b2f3442 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -404,6 +404,13 @@ For Python scripts: documentation for version 2.6 does not mention this prefix, it has been supported since version 2.6.0. +Error Messages + + - We typically do not end error messages with a full stop. While + we've been rather inconsistent in the past, these days we mostly + settle on no punctuation. + + Writing Documentation: Most (if not all) of the documentation pages are written in the -- 1.9.4.msysgit.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: State coding guideline for error message punctuation 2014-06-16 12:55 ` [PATCH] doc: State coding guideline for error message punctuation Philip Oakley @ 2014-06-16 18:52 ` Junio C Hamano 2014-06-16 19:57 ` Philip Oakley 2014-06-17 9:37 ` Jeff King 1 sibling, 1 reply; 8+ messages in thread From: Junio C Hamano @ 2014-06-16 18:52 UTC (permalink / raw) To: Philip Oakley; +Cc: GitList, Jeff King Philip Oakley <philipoakley@iee.org> writes: > Clarify error message puntuation to reduce review workload [1]. > > [1] http://article.gmane.org/gmane.comp.version-control.git/251547 > (see trailing 'nit' item). > > Signed-off-by: Philip Oakley <philipoakley@iee.org> > --- Hmmm. Do we really need to spell everything out? I would rather hope that we can rely on our contributors to know Git well enough to ask "git grep" after reading the "follow the style of existing and surrounding code" rule that governs the overall guideline. > Documentation/CodingGuidelines | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines > index 4d90c77..b2f3442 100644 > --- a/Documentation/CodingGuidelines > +++ b/Documentation/CodingGuidelines > @@ -404,6 +404,13 @@ For Python scripts: > documentation for version 2.6 does not mention this prefix, it has > been supported since version 2.6.0. > > +Error Messages > + > + - We typically do not end error messages with a full stop. While > + we've been rather inconsistent in the past, these days we mostly > + settle on no punctuation. > + > + > Writing Documentation: > > Most (if not all) of the documentation pages are written in the ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: State coding guideline for error message punctuation 2014-06-16 18:52 ` Junio C Hamano @ 2014-06-16 19:57 ` Philip Oakley 0 siblings, 0 replies; 8+ messages in thread From: Philip Oakley @ 2014-06-16 19:57 UTC (permalink / raw) To: Junio C Hamano; +Cc: GitList, Jeff King From: "Junio C Hamano" <gitster@pobox.com> > Philip Oakley <philipoakley@iee.org> writes: > >> Clarify error message puntuation to reduce review workload [1]. >> >> [1] http://article.gmane.org/gmane.comp.version-control.git/251547 >> (see trailing 'nit' item). >> >> Signed-off-by: Philip Oakley <philipoakley@iee.org> >> --- > > Hmmm. Do we really need to spell everything out? It was more of a case of 'do we often have to provide this guidance in reviews'? The trailing full stop does appear to come up moderately often, along with other punctuation issues. I am on the 'guidance of the wise and education of others' side of the camp, rather than they being rules and regulations (as was recently misunderstood), so lets educate. I haven't yet had the time to search deeply, but I'm sure I've also seen various bits of guidance on suitability and style of error messages in the last year of so that the section can be rounded out on that front as well (no doubt similar to some of the commit message guidance). > > I would rather hope that we can rely on our contributors to know Git > well enough to ask "git grep" after reading the "follow the style of > existing and surrounding code" rule that governs the overall > guideline. I don't see error messages as "code" per se, rather as an attempt at a consistent user interface[*], and the user errors can come from anywhere, so if we have settled on a style, let's say so. Philip [*] My distinction here: "code" is a developer interface, "commands and error messages" is the UI. > >> Documentation/CodingGuidelines | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/Documentation/CodingGuidelines >> b/Documentation/CodingGuidelines >> index 4d90c77..b2f3442 100644 >> --- a/Documentation/CodingGuidelines >> +++ b/Documentation/CodingGuidelines >> @@ -404,6 +404,13 @@ For Python scripts: >> documentation for version 2.6 does not mention this prefix, it >> has >> been supported since version 2.6.0. >> >> +Error Messages >> + >> + - We typically do not end error messages with a full stop. While >> + we've been rather inconsistent in the past, these days we mostly >> + settle on no punctuation. >> + >> + >> Writing Documentation: >> >> Most (if not all) of the documentation pages are written in the > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: State coding guideline for error message punctuation 2014-06-16 12:55 ` [PATCH] doc: State coding guideline for error message punctuation Philip Oakley 2014-06-16 18:52 ` Junio C Hamano @ 2014-06-17 9:37 ` Jeff King 2014-07-10 20:36 ` Junio C Hamano 1 sibling, 1 reply; 8+ messages in thread From: Jeff King @ 2014-06-17 9:37 UTC (permalink / raw) To: Philip Oakley; +Cc: GitList On Mon, Jun 16, 2014 at 01:55:57PM +0100, Philip Oakley wrote: > +Error Messages > + > + - We typically do not end error messages with a full stop. While > + we've been rather inconsistent in the past, these days we mostly > + settle on no punctuation. Unlike Junio, I do not mind spelling out guidance for error messages. However, I do not think the second sentence is adding anything here (everything in CodingGuidelines is subject to "we did not always do it this way, but this is the preferred way now"). So I'd drop it. And then add in more guidance. Besides "no full stop", probably: 1. do not capitalize ("unable to open %s", not "Unable to open %s" 2. maybe something on sentence structure / ordering? We tend to prefer "cannot open 'foo': No such file or directory" to "foo: cannot open: No such file or directory". Perhaps there are others (we do not have to be exhaustive, but it makes sense to think for a moment while we are here). -Peff ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: State coding guideline for error message punctuation 2014-06-17 9:37 ` Jeff King @ 2014-07-10 20:36 ` Junio C Hamano 2014-07-10 20:42 ` Jeff King 2014-07-15 19:28 ` Philip Oakley 0 siblings, 2 replies; 8+ messages in thread From: Junio C Hamano @ 2014-07-10 20:36 UTC (permalink / raw) To: Philip Oakley, Jeff King; +Cc: GitList Jeff King <peff@peff.net> writes: > On Mon, Jun 16, 2014 at 01:55:57PM +0100, Philip Oakley wrote: > >> +Error Messages >> + >> + - We typically do not end error messages with a full stop. While >> + we've been rather inconsistent in the past, these days we mostly >> + settle on no punctuation. > > Unlike Junio, I do not mind spelling out guidance for error messages. > However, I do not think the second sentence is adding anything here > (everything in CodingGuidelines is subject to "we did not always do it > this way, but this is the preferred way now"). So I'd drop it. > > And then add in more guidance. Besides "no full stop", probably: > > 1. do not capitalize ("unable to open %s", not "Unable to open %s" > > 2. maybe something on sentence structure / ordering? We tend to prefer > "cannot open 'foo': No such file or directory" to "foo: cannot > open: No such file or directory". > > Perhaps there are others (we do not have to be exhaustive, but it makes > sense to think for a moment while we are here). I do not want to forever be waiting for a reroll, so let's queue this and advance it to 'next' soonish, and refine the guidelines by further building on top of it as needed. Thanks. -- >8 -- From: Philip Oakley <philipoakley@iee.org> Date: Mon, 16 Jun 2014 13:55:57 +0100 Subject: [PATCH] doc: give some guidelines for error messages Clarify error message puntuation to reduce review workload. Signed-off-by: Philip Oakley <philipoakley@iee.org> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> --- Documentation/CodingGuidelines | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index f424dbd..f4137c6 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -264,6 +264,15 @@ For Python scripts: documentation for version 2.6 does not mention this prefix, it has been supported since version 2.6.0. +Error Messages + + - Do not end error messages with a full stop. + + - Do not capitalize ("unable to open %s", not "Unable to open %s") + + - Say what the error is first ("cannot open %s", not "%s: cannot open") + + Writing Documentation: Most (if not all) of the documentation pages are written in the -- 2.0.1-751-ge540734 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: State coding guideline for error message punctuation 2014-07-10 20:36 ` Junio C Hamano @ 2014-07-10 20:42 ` Jeff King 2014-07-15 19:28 ` Philip Oakley 1 sibling, 0 replies; 8+ messages in thread From: Jeff King @ 2014-07-10 20:42 UTC (permalink / raw) To: Junio C Hamano; +Cc: Philip Oakley, GitList On Thu, Jul 10, 2014 at 01:36:05PM -0700, Junio C Hamano wrote: > > Perhaps there are others (we do not have to be exhaustive, but it makes > > sense to think for a moment while we are here). > > I do not want to forever be waiting for a reroll, so let's queue > this and advance it to 'next' soonish, and refine the guidelines by > further building on top of it as needed. Yes, that looks good to me. Thanks for moving this forward. -Peff ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: State coding guideline for error message punctuation 2014-07-10 20:36 ` Junio C Hamano 2014-07-10 20:42 ` Jeff King @ 2014-07-15 19:28 ` Philip Oakley 1 sibling, 0 replies; 8+ messages in thread From: Philip Oakley @ 2014-07-15 19:28 UTC (permalink / raw) To: Junio C Hamano, Jeff King; +Cc: GitList From: "Junio C Hamano" <gitster@pobox.com> Sent: Thursday, July 10, 2014 9:36 PM > Jeff King <peff@peff.net> writes: > >> On Mon, Jun 16, 2014 at 01:55:57PM +0100, Philip Oakley wrote: >> >>> +Error Messages >>> + >>> + - We typically do not end error messages with a full stop. While >>> + we've been rather inconsistent in the past, these days we mostly >>> + settle on no punctuation. >> >> Unlike Junio, I do not mind spelling out guidance for error messages. >> However, I do not think the second sentence is adding anything here >> (everything in CodingGuidelines is subject to "we did not always do >> it >> this way, but this is the preferred way now"). So I'd drop it. >> >> And then add in more guidance. Besides "no full stop", probably: >> >> 1. do not capitalize ("unable to open %s", not "Unable to open %s" >> >> 2. maybe something on sentence structure / ordering? We tend to >> prefer >> "cannot open 'foo': No such file or directory" to "foo: cannot >> open: No such file or directory". >> >> Perhaps there are others (we do not have to be exhaustive, but it >> makes >> sense to think for a moment while we are here). > > I do not want to forever be waiting for a reroll, so let's queue > this and advance it to 'next' soonish, and refine the guidelines by > further building on top of it as needed. > Sorry, I've been away on vacation for the last few weeks. I hadn't been sure what to include in a re-roll without it gaining too much mission creep. Thanks for keeping an eye on it. > Thanks. > > -- >8 -- > From: Philip Oakley <philipoakley@iee.org> > Date: Mon, 16 Jun 2014 13:55:57 +0100 > Subject: [PATCH] doc: give some guidelines for error messages > > Clarify error message puntuation to reduce review workload. > > Signed-off-by: Philip Oakley <philipoakley@iee.org> > Helped-by: Jeff King <peff@peff.net> > Signed-off-by: Junio C Hamano <gitster@pobox.com> > --- > Documentation/CodingGuidelines | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/Documentation/CodingGuidelines > b/Documentation/CodingGuidelines > index f424dbd..f4137c6 100644 > --- a/Documentation/CodingGuidelines > +++ b/Documentation/CodingGuidelines > @@ -264,6 +264,15 @@ For Python scripts: > documentation for version 2.6 does not mention this prefix, it has > been supported since version 2.6.0. > > +Error Messages > + > + - Do not end error messages with a full stop. > + > + - Do not capitalize ("unable to open %s", not "Unable to open %s") > + > + - Say what the error is first ("cannot open %s", not "%s: cannot > open") > + > + > Writing Documentation: > > Most (if not all) of the documentation pages are written in the > -- > 2.0.1-751-ge540734 > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-07-15 19:28 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-06-16 12:55 [PATCH] Coding guideline for Error messages Philip Oakley 2014-06-16 12:55 ` [PATCH] doc: State coding guideline for error message punctuation Philip Oakley 2014-06-16 18:52 ` Junio C Hamano 2014-06-16 19:57 ` Philip Oakley 2014-06-17 9:37 ` Jeff King 2014-07-10 20:36 ` Junio C Hamano 2014-07-10 20:42 ` Jeff King 2014-07-15 19:28 ` Philip Oakley
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).