Debian Codegraph @

.clang-format

raw
1 Language: Cpp
2
3 # to apply these settings on git commit on changed lines only, the easiest way
4 # is to use pre-commit; read .pre-commit-config.yaml for details.
5 #
6 # Another way is this pre-commit hook:
7 # https://github.com/barisione/clang-format-hooks
8 # clone it somewhere, run '/path/to/clone/git-pre-commit-format install'
9
10 # test diff with
11 # git checkout src; find . -iname '*.h' -o -iname '*.cpp' | parallel clang-format -i; git diff src | wc -l
12 # diff count: 118038
13
14 # closest to our legacy style...
15 BasedOnStyle: Microsoft
16 IndentWidth: 4
17 AccessModifierOffset: -4
18 TabWidth: 4
19 UseTab: Never
20
21 # leave line breaks alone
22 ColumnLimit: 0
23 # note: it is still recommended to leave lines short, ideally below 80; but
24 # letting clang-format handle that does not work well enough and one needs
25 # to use tricks, like empty trailing comments.
26
27 # do not mess with includes
28 SortIncludes: false
29
30 # the code has them more often than not, and this follows the astyle config
31 # f( x ) instead of f(x)
32 # SpacesInParentheses: true
33 # But, I (Z-Man) don't like it any more. It does not improve readability.
34 # Might be my eyes, though.
35
36 # we have more "int* x" than "int *x" (or "int * x")
37 PointerAlignment: Left
38
39 AllowShortFunctionsOnASingleLine: true
40 AllowShortBlocksOnASingleLine: true
41
42 # Alignment options
43
44 # leave to individual choice for now
45 # AlignAfterOpenBracket: AlwaysBreak
46 #AlignConsecutiveMacros: false
47 #AlignConsecutiveAssignments: false
48 #AlignConsecutiveDeclarations: false
49 #AlignOperands: false
50 #AlignTrailingComments: true
51
52
53 #AllowAllConstructorInitializersOnNextLine: true