diff options
author | zimbatm <zimbatm@zimbatm.com> | 2018-11-27 22:14:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 22:14:41 +0100 |
commit | 064bd03b8c2faa534f3979051f5ecb267af9bc72 (patch) | |
tree | def25da298eb70727d0e029926bd55f2b4f8b434 /doc | |
parent | 63c7ed978828b9561bcc22185d32f4d67c57c117 (diff) |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coding-conventions.xml | 29 |
1 files changed, 17 insertions, 12 deletions
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: <programlisting> # 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"; + } +]; </programlisting> </para> </listitem> |