diff mbox

libxl/CODING_STYLE: Clarify the singular statement in a conditional statement explanation.

Message ID 1459523637-30104-1-git-send-email-konrad.wilk@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Konrad Rzeszutek Wilk April 1, 2016, 3:13 p.m. UTC
It takes a bit of thinking to parse the original statement. It looks
like it is missing an ',' - right after the 'braced' to make it
obvious that:

if (X)
   return XYZ;

is OK, while multiple conditionals require braces.

Changing the 'apart from' with 'except' makes it more obvious
(I hope).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
---
 tools/libxl/CODING_STYLE | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wei Liu April 1, 2016, 3:25 p.m. UTC | #1
On Fri, Apr 01, 2016 at 11:13:57AM -0400, Konrad Rzeszutek Wilk wrote:
> It takes a bit of thinking to parse the original statement. It looks
> like it is missing an ',' - right after the 'braced' to make it
> obvious that:
> 
> if (X)
>    return XYZ;
> 
> is OK, while multiple conditionals require braces.
> 
> Changing the 'apart from' with 'except' makes it more obvious
> (I hope).
> 
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> CC: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>

Not a native speaker, so I will defer this to Ian.

> ---
> ---
>  tools/libxl/CODING_STYLE | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
> index 522d1c9..01ee25b 100644
> --- a/tools/libxl/CODING_STYLE
> +++ b/tools/libxl/CODING_STYLE
> @@ -294,7 +294,7 @@ Libxenlight coding style is super simple.  Avoid tricky expressions.
>  
>  5. Block structure
>  
> -Every indented statement is braced apart from blocks that contain just
> +Every indented statement is braced, except blocks that contain just
>  one statement.
>  The opening brace is on the line that contains the control flow
>  statement that introduces the new block; the closing brace is on the
> -- 
> 2.5.0
>
Ian Jackson April 6, 2016, 1:53 p.m. UTC | #2
Konrad Rzeszutek Wilk writes ("[PATCH] libxl/CODING_STYLE: Clarify the singular statement in a conditional statement explanation."):
> It takes a bit of thinking to parse the original statement. It looks
> like it is missing an ',' - right after the 'braced' to make it
> obvious that:

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

And queued, thanks.

Ian.
diff mbox

Patch

diff --git a/tools/libxl/CODING_STYLE b/tools/libxl/CODING_STYLE
index 522d1c9..01ee25b 100644
--- a/tools/libxl/CODING_STYLE
+++ b/tools/libxl/CODING_STYLE
@@ -294,7 +294,7 @@  Libxenlight coding style is super simple.  Avoid tricky expressions.
 
 5. Block structure
 
-Every indented statement is braced apart from blocks that contain just
+Every indented statement is braced, except blocks that contain just
 one statement.
 The opening brace is on the line that contains the control flow
 statement that introduces the new block; the closing brace is on the