From 064bd03b8c2faa534f3979051f5ecb267af9bc72 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 27 Nov 2018 22:14:41 +0100 Subject: doc: tweak the coding conventions (#51113) Encouraging to put container elements on their own lines to minimize diffs, merge conflicts and making re-ordering easier. Nix doesn't suffer the restrictions of other languages where commas are used to separate list items. --- doc/coding-conventions.xml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'doc/coding-conventions.xml') diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml index 2d2018c72d25..a8a4557b461c 100644 --- a/doc/coding-conventions.xml +++ b/doc/coding-conventions.xml @@ -56,25 +56,30 @@ foo { arg = ...; } or list elements should be aligned: # A long list. -list = - [ elem1 - elem2 - elem3 - ]; +list = [ + elem1 + elem2 + elem3 +]; # A long attribute set. -attrs = - { attr1 = short_expr; - attr2 = - if true then big_expr else big_expr; - }; - -# Alternatively: attrs = { attr1 = short_expr; attr2 = if true then big_expr else big_expr; }; + +# Combined +listOfAttrs = [ + { + attr1 = 3; + attr2 = "fff"; + } + { + attr1 = 5; + attr2 = "ggg"; + } +]; -- cgit v1.2.3