diff options
author | Sylvestre Ledru <sylvestre.ledru@scilab-enterprises.com> | 2012-08-10 11:34:20 +0200 |
---|---|---|
committer | Sylvestre Ledru <sylvestre.ledru@scilab-enterprises.com> | 2012-08-10 11:36:41 +0200 |
commit | 3604ed3d6521f6e8d76bfe4496a16bb7c1d81677 (patch) | |
tree | 9732f2b8d6925c1b3e147498ada6de807a2f3c75 /git_hooks/pre-commit | |
parent | 6b2b559d8e38867a3d823689f7ce09bb78ff1f09 (diff) | |
download | scilab-3604ed3d6521f6e8d76bfe4496a16bb7c1d81677.zip scilab-3604ed3d6521f6e8d76bfe4496a16bb7c1d81677.tar.gz |
Common command factorized
Change-Id: I16e2248c681f6cc4533ccdb0d2788b7d94e492e7
Diffstat (limited to 'git_hooks/pre-commit')
-rwxr-xr-x | git_hooks/pre-commit | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit index 5a943fe..7b1528d 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 | ||
178 | COMMON_ASTYLE_ARGS="--pad-header -n --pad-oper --indent-col1-comments --indent-switches" | 178 | COMMON_ASTYLE_ARGS="--pad-header -n --pad-oper --indent-col1-comments --indent-switches --indent=spaces=4" |
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 --indent=spaces=4 -A1 "$file" || return 2 | 183 | $ASTYLE $COMMON_ASTYLE_ARGS --style=linux -A1 "$file" || return 2 |
184 | __post_indent || return 3 | 184 | __post_indent || return 3 |
185 | return 0 | 185 | return 0 |
186 | } | 186 | } |
@@ -188,7 +188,7 @@ __indent_C() { | |||
188 | # Indent the file with `astyle' if this is a Java file | 188 | # Indent the file with `astyle' if this is a Java file |
189 | __indent_java() { | 189 | __indent_java() { |
190 | __pre_indent || return 1 | 190 | __pre_indent || return 1 |
191 | $ASTYLE $COMMON_ASTYLE_ARGS --style=java --indent=spaces=4 "$file" || return 2 | 191 | $ASTYLE $COMMON_ASTYLE_ARGS --style=java "$file" || return 2 |
192 | __post_indent || return 3 | 192 | __post_indent || return 3 |
193 | return 0 | 193 | return 0 |
194 | } | 194 | } |