[PATCH v2 19/22] docs: Adjust contributor guidelines about curly brackets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After recent discussion it looks like curly brackets around one-line
bodies are preferred if the preceding condition is, itself, multiline.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 HACKING              | 8 ++++----
 docs/hacking.html.in | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/HACKING b/HACKING
index 8f42e51..0f36405 100644
--- a/HACKING
+++ b/HACKING
@@ -370,10 +370,10 @@ although use of a semicolon is not currently rejected.

 Curly braces
 ============
-Omit the curly braces around an "if", "while", "for" etc. body only when that
-body occupies a single line. In every other case we require the braces. This
-ensures that it is trivially easy to identify a single-'statement' loop: each
-has only one 'line' in its body.
+Omit the curly braces around an "if", "while", "for" etc. body only when both
+that body and the condition itself occupy a single line. In every other case
+we require the braces. This ensures that it is trivially easy to identify a
+single-'statement' loop: each has only one 'line' in its body.

 Omitting braces with a single-line body is fine:

diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index b1553a5..fac1417 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -462,8 +462,8 @@

     <p>
       Omit the curly braces around an <code>if</code>, <code>while</code>,
-      <code>for</code> etc. body only
-      when that body occupies a single line.  In every other case we require
+      <code>for</code> etc. body only when both that body and the condition
+      itself occupy a single line.  In every other case we require
       the braces.  This ensures that it is trivially easy to identify a
       single-<i>statement</i> loop: each has only one <i>line</i> in its body.
     </p>
-- 
2.1.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]