]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Clarify the coding style.
authorBruno Haible <bruno@clisp.org>
Wed, 13 Mar 2019 19:00:53 +0000 (20:00 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 13 Mar 2019 19:03:11 +0000 (20:03 +0100)
Suggested by Pavel Raiskup <praiskup@redhat.com>.

* gnulib-tool: Add comment about coding style.

ChangeLog
gnulib-tool

index e5ba0caa4bac7b4b85a4fb3c45236cd2afe529b8..3a44133d9aef94c953311a5fac0a9a49b7d412a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-03-13  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Clarify the coding style.
+       Suggested by Pavel Raiskup <praiskup@redhat.com>.
+       * gnulib-tool: Add comment about coding style.
+
 2019-03-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        strtod: fix clash with strtold
index 34d198f6d7fc972a85997b46ab18f452318526f2..a41522ba0ea37697a32e8b886d2edf0d336874c0 100755 (executable)
 # This program is meant for authors or maintainers which want to import
 # modules from gnulib into their packages.
 
+# CODING STYLE for this file:
+# * Indentation: Indent by 2 spaces. Indent case clauses by 2 spaces as well.
+# * Shell variable references: Use double-quote around shell variable
+#   references always (except when word splitting is explicitly desired),
+#   even when you know the double-quote are not needed.  This style tends to
+#   avoid undesired word splitting caused by omitted double-quotes (the
+#   number one mistake in shell scripts).
+#   When the referenced variable can only have a finite number of possible
+#   values and these values are all simple words (e.g. true and false), it's
+#   OK to omit the double-quotes.
+# * Backquotes:
+#   - Use backquotes like in `command`, not $(command).
+#   - Don't use `command` inside double-quotes. Instead assign the result of
+#     `command` to a variable, and use the value of the variable afterwards.
+# * Functions:
+#   - All functions that don't emulate a program or shell built-in have a name
+#     that starts with 'func_'.
+#   - Document the implicit and explicit arguments of all functions, as well
+#     as their output variables and side effects.
+# * Use  test condition  instead of  [ condition ].
+# * Minimize the use of eval; when you need it, make sure the string to be
+#   evaluated has a very simple syntactic structure.
+
 progname=$0
 package=gnulib
 nl='