summary refs log tree commit diff
path: root/doc/coding-conventions.xml
diff options
context:
space:
mode:
authorYegor Timoshenko <yegortimoshenko@gmail.com>2017-12-23 17:12:29 +0300
committerGitHub <noreply@github.com>2017-12-23 17:12:29 +0300
commit108f76c9277d68cbf6a4e814a6667a6609671949 (patch)
tree2b360ec3558dea75096c7ff5258f4efc6b93df8f /doc/coding-conventions.xml
parentda5f6aa6baa08d0dcbb59e8dd577f8de65a932a7 (diff)
parent91154416b650e7a09c44b0c0d97399bc5c849117 (diff)
downloadnixlib-108f76c9277d68cbf6a4e814a6667a6609671949.tar
nixlib-108f76c9277d68cbf6a4e814a6667a6609671949.tar.gz
nixlib-108f76c9277d68cbf6a4e814a6667a6609671949.tar.bz2
nixlib-108f76c9277d68cbf6a4e814a6667a6609671949.tar.lz
nixlib-108f76c9277d68cbf6a4e814a6667a6609671949.tar.xz
nixlib-108f76c9277d68cbf6a4e814a6667a6609671949.tar.zst
nixlib-108f76c9277d68cbf6a4e814a6667a6609671949.zip
Merge pull request #31668 from rycee/doc/naming
docs: clarify package and module option naming
Diffstat (limited to 'doc/coding-conventions.xml')
-rw-r--r--doc/coding-conventions.xml25
1 files changed, 13 insertions, 12 deletions
diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml
index 765fc56c3bb3..d556c7ebe1ed 100644
--- a/doc/coding-conventions.xml
+++ b/doc/coding-conventions.xml
@@ -18,9 +18,9 @@
   tab settings so it’s asking for trouble.</para></listitem>
 
   <listitem><para>Use <literal>lowerCamelCase</literal> for variable
-  names, not <literal>UpperCamelCase</literal>.  TODO: naming of
-  attributes in
-  <filename>all-packages.nix</filename>?</para></listitem>
+  names, not <literal>UpperCamelCase</literal>.  Note, this rule does
+  not apply to package attribute names, which instead follow the rules
+  in <xref linkend="sec-package-naming"/>.</para></listitem>
 
   <listitem><para>Function calls with attribute set arguments are
   written as
@@ -220,9 +220,10 @@ args.stdenv.mkDerivation (args // {
 
   <listitem><para>The variable name used for the instantiated package
   in <filename>all-packages.nix</filename>, and when passing it as a
-  dependency to other functions.  This is what Nix expression authors
-  see.  It can also be used when installing using <command>nix-env
-  -iA</command>.</para></listitem>
+  dependency to other functions.  Typically this is called the
+  <emphasis>package attribute name</emphasis>.  This is what Nix
+  expression authors see.  It can also be used when installing using
+  <command>nix-env -iA</command>.</para></listitem>
 
   <listitem><para>The filename for (the directory containing) the Nix
   expression.</para></listitem>
@@ -259,12 +260,12 @@ bound to the variable name <varname>e2fsprogs</varname> in
   Also append <literal>"unstable"</literal> to the name - e.g.,
   <literal>"pkgname-unstable-2014-09-23"</literal>.</para></listitem>
 
-  <listitem><para>Dashes in the package name should be preserved
-  in new variable names, rather than converted to underscores
-  (which was convention up to around 2013 and most names
-   still have underscores instead of dashes) — e.g.,
-  <varname>http-parser</varname> instead of
-  <varname>http_parser</varname>.</para></listitem>
+  <listitem><para>Dashes in the package name should be preserved in
+  new variable names, rather than converted to underscores or camel
+  cased — e.g., <varname>http-parser</varname> instead of
+  <varname>http_parser</varname> or <varname>httpParser</varname>.  The
+  hyphenated style is preferred in all three package
+  names.</para></listitem>
 
   <listitem><para>If there are multiple versions of a package, this
   should be reflected in the variable names in