File tree 3 files changed +79
-0
lines changed
3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ # display changed items only
3
+ Language : Cpp
4
+ BasedOnStyle : Google
5
+ AccessModifierOffset : -4
6
+ AllowShortEnumsOnASingleLine : true
7
+ AllowShortBlocksOnASingleLine : Empty
8
+ AllowShortCaseLabelsOnASingleLine : false
9
+ AllowShortFunctionsOnASingleLine : Inline
10
+ AllowShortLambdasOnASingleLine : All
11
+ AllowShortIfStatementsOnASingleLine : Never
12
+ AllowShortLoopsOnASingleLine : false
13
+ AlwaysBreakBeforeMultilineStrings : false
14
+ AlwaysBreakTemplateDeclarations : Yes
15
+ BreakBeforeBraces : Custom
16
+ BraceWrapping :
17
+ AfterCaseLabel : true
18
+ AfterClass : true
19
+ AfterControlStatement : Always
20
+ AfterEnum : true
21
+ AfterFunction : true
22
+ AfterNamespace : false
23
+ AfterObjCDeclaration : false
24
+ AfterStruct : true
25
+ AfterUnion : true
26
+ AfterExternBlock : true
27
+ BeforeCatch : false
28
+ BeforeElse : false
29
+ BeforeLambdaBody : false
30
+ BeforeWhile : false
31
+ IndentBraces : false
32
+ SplitEmptyFunction : false
33
+ SplitEmptyRecord : false
34
+ SplitEmptyNamespace : false
35
+ BreakBeforeTernaryOperators : false
36
+ ColumnLimit : 129
37
+ CompactNamespaces : true
38
+ IndentWidth : 4
39
+ ...
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ if(CPPBASE_BUILD_TESTING)
47
47
add_subdirectory (tests)
48
48
endif ()
49
49
50
+ include (ClangFormat)
51
+ clang_format_recurse("common" "logging" "network" "tests" )
52
+
50
53
install (FILES
51
54
${CMAKE_CURRENT_SOURCE_DIR} /common/Global .h
52
55
${CMAKE_CURRENT_SOURCE_DIR} /common/Semaphore.h
Original file line number Diff line number Diff line change
1
+ # project/
2
+ # --third3ty/
3
+ # --src/
4
+ # --test/
5
+ # --doc/
6
+ # --.clang_format
7
+ #
8
+ # clang_format_recurse("src" "test")
9
+
10
+ option (USE_CLANG_FORMAT "Apply clang-format to files in-place." OFF )
11
+
12
+ function (clang_format_recurse DIRS...)
13
+ if (USE_CLANG_FORMAT)
14
+ # Try to locate "clang-format"
15
+ find_program (CLANG_FORMAT clang-format PATHS ENV PATH )
16
+ if (CLANG_FORMAT)
17
+ message (STATUS "clang-format found at: ${CLANG_FORMAT} " )
18
+ execute_process (COMMAND ${CLANG_FORMAT} --version )
19
+ else ()
20
+ message (FATAL_ERROR "clang-format not found, style not available" )
21
+ endif ()
22
+
23
+ # Process individual file
24
+ foreach (DIR ${ARGV} )
25
+ file (GLOB_RECURSE FILES
26
+ "${DIR} /*.cpp"
27
+ "${DIR} /*.h"
28
+ "${DIR} /*.hpp"
29
+ )
30
+ foreach (FILE ${FILES} )
31
+ if (NOT "${FILE} " STREQUAL "" )
32
+ execute_process (COMMAND ${CLANG_FORMAT} -style=file -i ${FILE} )
33
+ endif ()
34
+ endforeach (FILE)
35
+ endforeach (DIR)
36
+ endif ()
37
+ endfunction (clang_format_recurse)
You can’t perform that action at this time.
0 commit comments