1 # DO NOT COMMIT OR MERGE CODE THAT IS RUN THROUGH THIS TOOL YET.
3 # WE ARE STILL DISCUSSING OUR DESIRED STYLE AND ITERATING ON IT.
8 # Out of all supported styles, LLVM seems closest to our own.
13 # Deviations from LLVM's style.
17 # We prefer an indentation width of 4 columns; LLVM likes 2.
18 ## OVERRIDE FOR COMPARISON
21 ## OVERRIDE FOR COMPARISON
22 ## for now i'm not sorting includes, since that makes every file get touched.
25 # We prefer 79; llvm likes 80.
28 # Where do we want to put backslashes on multiline macros? Our choices are
29 # "as far left as possible", "as far right as possible", and "make no changes."
30 # LLVM defaults to right, but we don't dig that.
31 AlignEscapedNewlines: Left
33 # When we see a bunch of things in a row with comments after them, should we
34 # try to align those comments? Doing so makes some of our code pretty ugly.
35 AlignTrailingComments: false
37 # We use a function declaration style much closer to BSD KNF than to LLVM's.
45 # whereas llvm prefers:
51 # int foo(int x) { ... }
53 BreakBeforeBraces: Custom
56 AllowShortFunctionsOnASingleLine: None
57 AlwaysBreakAfterReturnType: AllDefinitions
59 # We don't like blocks to start with an empty line.
61 KeepEmptyLinesAtTheStartOfBlocks: false
70 # These comments are magical, and should not be changed.
72 CommentPragmas: 'LCOV_EXCL|COVERITY'
75 # Remove duplicate empty lines.
77 MaxEmptyLinesToKeep: 1
80 # Indent preprocessor directives, for clarity.
82 IndentPPDirectives: AfterHash
85 # These introduce an iteration, and work a bit like a for loop.
87 # Note that we can NOT include ones that don't work like "for". For example,
88 # if the body is an argument to the macro, we can't list it here.
94 - TOR_SIMPLEQ_FOREACH_SAFE
96 - TOR_SLIST_FOREACH_SAFE
98 - TOR_LIST_FOREACH_SAFE
100 - TOR_TAILQ_FOREACH_SAFE
101 - TOR_TAILQ_FOREACH_REVERSE
102 - TOR_TAILQ_FOREACH_REVERSE_SAFE
103 - TOR_CIRCLEQ_FOREACH
104 - TOR_CIRCLEQ_FOREACH_SAFE
105 - TOR_CIRCLEQ_FOREACH_REVERSE
106 - TOR_CIRCLEQ_FOREACH_REVERSE_SAFE
108 - SMARTLIST_FOREACH_BEGIN
110 - DIGESTMAP_FOREACH_MODIFY
111 - DIGEST256MAP_FOREACH
112 - DIGEST256MAP_FOREACH_MODIFY
120 # - SMARTLIST_FOREACH, since the body of the loop is an argument.
123 # This explains how to sort our headers.
125 # This is more complex than it truly should be, but I've edited this till
126 # compilation still mostly passes.
128 # I'm disabling this, however, since it's a distraction from the other
129 # formatting issues. See SortIncludes above.
132 - Regex: '^"orconfig.h'
138 - Regex: '^"core/or/or.h'
142 - Regex: '^"feature/'
148 # These macros should always cause indentation, as though they were { and }.
150 # Do NOT put macros here unless you want an extra level of indentation between
151 # them whenever they appear.
153 MacroBlockBegin: "^STMT_BEGIN|TT_STMT_BEGIN$"
154 MacroBlockEnd: "^STMT_END|TT_STMT_END$"
157 # These macros are interpreted as types.
158 # (Not supported in my clang-format)