]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: coding-style: One variable declaration per line
authorTim Wiederhake <twiederh@redhat.com>
Thu, 13 Jan 2022 16:53:25 +0000 (17:53 +0100)
committerTim Wiederhake <twiederh@redhat.com>
Wed, 19 Jan 2022 13:54:08 +0000 (14:54 +0100)
This was not mentioned before.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
docs/coding-style.rst

index af928a16c03011ada84db7f2bb867c6ec01b57e6..cb23751721bfd7384a6bf4f17ca44155a9e96c94 100644 (file)
@@ -600,6 +600,19 @@ calling another function.
         ...
     }
 
+Prefer variable definitions on separate lines. This allows for smaller,
+easier to understand diffs when changing them. Define variables in the
+smallest possible scope.
+
+::
+
+  GOOD:
+    int count = 0;
+    int nnodes;
+
+  BAD:
+    int count = 0, nnodes;
+
 Attribute annotations
 ---------------------