# HG changeset patch # User Bruno Haible # Date 1552503653 -3600 # Node ID fab7ce42e03ffaf3450ba30f6bb7bac96ccbadcd # Parent 331ec5f027a29e1ef50733f1ac212e47e38c7ca7 gnulib-tool: Clarify the coding style. Suggested by Pavel Raiskup . * gnulib-tool: Add comment about coding style. diff -r 331ec5f027a2 -r fab7ce42e03f ChangeLog --- a/ChangeLog Wed Mar 13 11:14:26 2019 -0700 +++ b/ChangeLog Wed Mar 13 20:00:53 2019 +0100 @@ -1,3 +1,9 @@ +2019-03-13 Bruno Haible + + gnulib-tool: Clarify the coding style. + Suggested by Pavel Raiskup . + * gnulib-tool: Add comment about coding style. + 2019-03-11 Paul Eggert strtod: fix clash with strtold diff -r 331ec5f027a2 -r fab7ce42e03f gnulib-tool --- a/gnulib-tool Wed Mar 13 11:14:26 2019 -0700 +++ b/gnulib-tool Wed Mar 13 20:00:53 2019 +0100 @@ -19,6 +19,29 @@ # 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='