File tree Expand file tree Collapse file tree 3 files changed +79
-0
lines changed
Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 1+ Language : Cpp
2+
3+ IndentWidth : 4
4+ ContinuationIndentWidth : 8
5+
6+ ColumnLimit : 120
7+
8+ AlignAfterOpenBracket : false
9+
10+ AlignConsecutiveAssignments : true
11+
12+ # not supported in clang-format-3.7
13+ # supported in clang-format-3.8 and above
14+ AlignConsecutiveDeclarations : true
15+
16+ AlignTrailingComments : true
17+
18+ AllowAllParametersOfDeclarationOnNextLine : true
19+
20+ AllowShortBlocksOnASingleLine : false
21+ AllowShortFunctionsOnASingleLine : false
22+ AllowShortIfStatementsOnASingleLine : false
23+ AllowShortLoopsOnASingleLine : false
24+
25+ # Control of individual brace wrapping cases
26+ # not supported in clang-format-3.7
27+ # supported in clang-format-3.8 and above
28+ BraceWrapping : {
29+ AfterClass : ' true'
30+ AfterControlStatement : ' false'
31+ AfterEnum : ' true'
32+ AfterFunction : ' true'
33+ AfterNamespace : ' true'
34+ AfterStruct : ' true'
35+ AfterUnion : ' true'
36+ BeforeCatch : ' true'
37+ BeforeElse : ' false'
38+ IndentBraces : ' false'
39+ }
40+
41+ BreakBeforeBraces : Stroustrup
42+
43+ IndentCaseLabels : true
44+
45+ KeepEmptyLinesAtTheStartOfBlocks : true
46+
47+ MaxEmptyLinesToKeep : 1
48+
49+ # Pointer is aligned to right side
50+ PointerAlignment : Right
51+
52+ # High penalty to avoid line break just after return type
53+ PenaltyReturnTypeOnItsOwnLine : 10000
54+
55+ SpaceAfterCStyleCast : true
56+
57+ SpacesInParentheses : false
58+ SpaceInEmptyParentheses : false
59+ SpaceBeforeParens : ControlStatements
60+
61+ UseTab : Never
Original file line number Diff line number Diff line change @@ -8,3 +8,15 @@ ChangeLog:
88AUTHORS : ChangeLog
99 ( echo " Authors and contributors, in alphabetical order: " ; echo ; \
1010 sed -r " s/^Author: (.*)/\1/;t;d" $< | sort -u ) > $@
11+
12+ if HAVE_CLANG_FORMAT
13+
14+ .PHONY : reformat
15+
16+ reformat :
17+ @echo " Reformatting header files..."
18+ @CLANG_FORMAT@ -style=file -i ` find . -name " *.h" `
19+ @echo " Reformatting C files..."
20+ @CLANG_FORMAT@ -style=file -i ` find . -name " *.c" `
21+
22+ endif
Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ AC_CONFIG_SRCDIR([src/igmpproxy.c])
55AC_CONFIG_HEADERS ( [ config.h] )
66AC_PROG_CC_C99
77
8+ AC_CHECK_PROGS (
9+ [ CLANG_FORMAT] , [ clang-format clang-format-4.0 clang-format-3.9] ,
10+ [ AC_MSG_ERROR ( [ clang-format was not not found during configure.] ) ]
11+ )
12+ AM_CONDITIONAL([ HAVE_CLANG_FORMAT] , [ test -n "$CLANG_FORMAT"] )
13+
814AC_CANONICAL_HOST
915case $host_os in
1016 linux*|uclinux*) os=linux;;
You can’t perform that action at this time.
0 commit comments