File tree 3 files changed +42
-0
lines changed
3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This file is used by clang-format to autoformat paddle source code
2
+ #
3
+ # The clang-format is part of llvm toolchain.
4
+ # It need to install llvm and clang to format source code style.
5
+ #
6
+ # The basic usage is,
7
+ # clang-format -i -style=file PATH/TO/SOURCE/CODE
8
+ #
9
+ # The -style=file implicit use ".clang-format" file located in one of
10
+ # parent directory.
11
+ # The -i means inplace change.
12
+ #
13
+ # The document of clang-format is
14
+ # http://clang.llvm.org/docs/ClangFormat.html
15
+ # http://clang.llvm.org/docs/ClangFormatStyleOptions.html
16
+ ---
17
+ Language : Cpp
18
+ BasedOnStyle : Google
19
+ IndentWidth : 2
20
+ TabWidth : 2
21
+ ContinuationIndentWidth : 4
22
+ MaxEmptyLinesToKeep : 2
23
+ AccessModifierOffset : -2 # The private/protected/public has no indent in class
24
+ Standard : Cpp11
25
+ AllowAllParametersOfDeclarationOnNextLine : true
26
+ BinPackParameters : false
27
+ BinPackArguments : false
28
+ ...
29
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # clang-format hook without version check
4
+
5
+ clang-format $@
Original file line number Diff line number Diff line change 25
25
files : \.md$
26
26
- id : remove-tabs
27
27
files : \.md$
28
+ - repo : local
29
+ hooks :
30
+ - id : clang-format
31
+ name : clang-format
32
+ description : Format files with ClangFormat
33
+ entry : bash .clang_format.hook -i
34
+ language : system
35
+ files : \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
28
36
- repo : local
29
37
hooks :
30
38
- id : convert-markdown-into-html
You can’t perform that action at this time.
0 commit comments