summaryrefslogtreecommitdiff
path: root/efl-indent
blob: c3c8cf01aed88d6e4da7198735a5b25a2a5f1ca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# EFL style

BLANKS="\
	--blank-lines-after-declarations \
	--blank-lines-after-procedures \
	--blank-lines-before-block-comments \
	--swallow-optional-blank-lines"

COMMENTS=" \
	--format-all-comments \
	--format-first-column-comments \
	--no-comment-delimiters-on-blank-lines \
	--start-left-side-of-comments \
	--line-comments-indentation0 \
	--comment-indentation33 \
	--declaration-comment-column33 \
	--else-endif-column33"
	
STATEMENTS=" \
	--braces-after-if-lines \
	--cuddle-else \
	--cuddle-do-while \
	--case-indentation2 \
	--case-brace-indentation2 \
	--space-special-semicolon \
	--no-space-after-function-call-names \
	--space-after-cast \
	--space-after-for \
	--space-after-if \
	--space-after-while \
	--no-space-after-parentheses"

DECLARATIONS=" \
	--no-blank-lines-after-commas \
	--dont-break-function-decl-args \
	--dont-break-function-decl-args-end \
	--procnames-start-lines \
	--braces-after-struct-decl-line \
	--braces-after-func-def-line"

#	--declaration-indentation1

INDENTATION=" \
	--indent-level3 \
	--continuation-indentation4 \
	--dont-line-up-parentheses \
	--parameter-indentation2 \
	--preprocessor-indentation1 \
	--indent-label2"
	
BREAK_LONG_LINES=" \
	--line-length80 \
	--ignore-newlines \
	--break-after-boolean-operator"


# Fix indentation
indent $BLANKS $COMMENTS $STATEMENTS $DECLARATIONS $INDENTATION $BREAK_LONG_LINES $1

# Remove all trailing whitespaces
sed 's/[ \t]*$//' -i $1