summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ebuild-format.rst27
1 files changed, 27 insertions, 0 deletions
diff --git a/ebuild-format.rst b/ebuild-format.rst
index 89ebeda..9f78705 100644
--- a/ebuild-format.rst
+++ b/ebuild-format.rst
@@ -1,6 +1,33 @@
Ebuild file format
==================
+.. index::
+ single: bash; conditions
+ single: bash; variable reference
+ single: indentation
+
+Coding style
+------------
+:Source: QA
+:Reported: partially via repoman and pkgcheck
+
+While Gentoo leaves most of the coding style choices to developers,
+there are a few rules which we try to enforce. Those are:
+
+- Always indent using a single tab for indentation level. Do not
+ attempt to align, as it will not work with different tab widths.
+
+- Whenever using named variables, use bracketed variable form, i.e.
+ ``${foo}`` rather than ``$foo``.
+
+- Use bash conditions ``[[ ... ]]`` rather than POSIX-ish ``[ ... ]``
+ or ``test`` builtin.
+
+*Rationale*: the recommended constructs are less error-prone.
+Consistency avoids unnecessary changes when other developers edit
+the ebuild.
+
+
.. index:: eblit
Code must be contained within ebuild and eclasses