Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
CodingGuidelines: give an example for shell function preamble
author
Junio C Hamano
<gitster@pobox.com>
Wed, 30 Apr 2014 21:25:11 +0000
(14:25 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 2 May 2014 20:24:57 +0000
(13:24 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
9dbe780
)
diff --git
a/Documentation/CodingGuidelines
b/Documentation/CodingGuidelines
index 47db6b3ce36a7964127c294740ca0073a6181050..0a574b204c00d2a577f73bf9687dbbc491797a44 100644
(file)
--- a/
Documentation/CodingGuidelines
+++ b/
Documentation/CodingGuidelines
@@
-123,9
+123,17
@@
For shell scripts specifically (not exhaustive):
- We do not write the noiseword "function" in front of shell
functions.
- We do not write the noiseword "function" in front of shell
functions.
- - We prefer a space between the function name and the parentheses. The
- opening "{" should also be on the same line.
- E.g.: my_function () {
+ - We prefer a space between the function name and the parentheses,
+ and no space inside the parentheses. The opening "{" should also
+ be on the same line.
+
+ (incorrect)
+ my_function(){
+ ...
+
+ (correct)
+ my_function () {
+ ...
- As to use of grep, stick to a subset of BRE (namely, no \{m,n\},
[::], [==], or [..]) for portability.
- As to use of grep, stick to a subset of BRE (namely, no \{m,n\},
[::], [==], or [..]) for portability.