summaryrefslogtreecommitdiffstats
path: root/git_hooks
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>2012-09-24 11:23:28 +0200
committerSylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>2012-09-24 11:31:09 +0200
commit74d51041d4a2bea23b674813c80f8c6ab46b2596 (patch)
treea9dfe5aae1120b8eb952f1cd2653f238e0432f47 /git_hooks
parent4c401a2122214c144948d85d1ac7bc58e4ae13cf (diff)
downloadscilab-74d51041d4a2bea23b674813c80f8c6ab46b2596.zip
scilab-74d51041d4a2bea23b674813c80f8c6ab46b2596.tar.gz
* Update of the C/C++/java hooks:
- use the extended form of the options - remove duplicate options - Add --add-brackets Change-Id: I31410ff1fd4863d70f42e5eb69deecf3c16000de
Diffstat (limited to 'git_hooks')
-rwxr-xr-xgit_hooks/pre-commit4
1 files changed, 2 insertions, 2 deletions
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit
index 0a38b4a..6fcf228 100755
--- a/git_hooks/pre-commit
+++ b/git_hooks/pre-commit
@@ -175,12 +175,12 @@ __post_indent() {
175 git add "$file" 175 git add "$file"
176} 176}
177 177
178COMMON_ASTYLE_ARGS="--pad-header -n --pad-oper --indent-col1-comments --indent-switches --indent=spaces=4" 178COMMON_ASTYLE_ARGS="--pad-header --suffix=none --pad-oper --indent-col1-comments --indent-switches --indent=spaces=4 --add-brackets --formatted"
179 179
180# Indent the file with `astyle' if this is a C/CPP file 180# Indent the file with `astyle' if this is a C/CPP file
181__indent_C() { 181__indent_C() {
182 __pre_indent || return 1 182 __pre_indent || return 1
183 $ASTYLE $COMMON_ASTYLE_ARGS --style=linux -A1 "$file" || return 2 183 $ASTYLE $COMMON_ASTYLE_ARGS --style=bsd "$file" || return 2
184 __post_indent || return 3 184 __post_indent || return 3
185 return 0 185 return 0
186} 186}