summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>2011-10-12 19:41:24 +0000
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>2011-10-12 19:41:24 +0000
commit65aa7680cfbfe975f8755fc93e4abd8435af06de (patch)
tree43393cdd7caae4abc0c0f787e729d678f52eb2db
parentaffdd5c176c1799a8334d5e4e39cd94f1b8e14bd (diff)
Add a new formatting script using GNU indent
SVN revision: 64024
-rwxr-xr-xefl-indent62
1 files changed, 62 insertions, 0 deletions
diff --git a/efl-indent b/efl-indent
new file mode 100755
index 0000000..510851b
--- /dev/null
+++ b/efl-indent
@@ -0,0 +1,62 @@
1#!/bin/bash
2# EFL style
3
4BLANKS="\
5 --blank-lines-after-declarations \
6 --blank-lines-after-procedures \
7 --blank-lines-before-block-comments \
8 --swallow-optional-blank-lines"
9
10COMMENTS=" \
11 --format-all-comments \
12 --format-first-column-comments \
13 --no-comment-delimiters-on-blank-lines \
14 --start-left-side-of-comments \
15 --line-comments-indentation0 \
16 --comment-indentation33 \
17 --declaration-comment-column33 \
18 --else-endif-column33"
19
20STATEMENTS=" \
21 --braces-after-if-lines \
22 --cuddle-else \
23 --cuddle-do-while \
24 --case-indentation2 \
25 --case-brace-indentation2 \
26 --space-special-semicolon \
27 --no-space-after-function-call-names \
28 --space-after-cast \
29 --space-after-for \
30 --space-after-if \
31 --space-after-while \
32 --no-space-after-parentheses"
33
34DECLARATIONS=" \
35 --declaration-indentation1 \
36 --no-blank-lines-after-commas \
37 --dont-break-function-decl-args \
38 --dont-break-function-decl-args-end \
39 --procnames-start-lines \
40 --braces-on-struct-decl-line \
41 --braces-after-func-def-line"
42
43INDENTATION=" \
44 --indent-level3 \
45 --continuation-indentation4 \
46 --dont-line-up-parentheses \
47 --parameter-indentation2 \
48 --preprocessor-indentation1 \
49 --indent-label2"
50
51BREAK_LONG_LINES=" \
52 --line-length80 \
53 --ignore-newlines \
54 --break-after-boolean-operator"
55
56
57# Fix indentation
58indent $BLANKS $COMMENTS $STATEMENTS $DECLARATIONS $INDENTATION $BREAK_LONG_LINES $1
59
60# Remove all trailing whitespaces
61sed 's/[ \t]*$//' -i $1
62