summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2017-09-19 10:48:02 +0200
committerPhilipp Stephani <phst@google.com>2017-09-24 10:47:11 +0200
commit108df97bf7d9d93f9fe976ad1e52388920076eba (patch)
treee4fff0932effea2780c2b4c21757dca09b31bbd5 /.clang-format
parent1eb4e5c3c8e70813c8042a38a2b67be74b16500e (diff)
downloademacs-108df97bf7d9d93f9fe976ad1e52388920076eba.tar.gz
Add configuration for clang-format.
This allows developers to auto-format the C code with clang-format. It’s not 100% accurate, but works pretty well for most of the C code.
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format27
1 files changed, 27 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 00000000000..7895ada36da
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,27 @@
+Language: Cpp
+BasedOnStyle: LLVM
+AlignEscapedNewlinesLeft: true
+AlwaysBreakAfterReturnType: TopLevelDefinitions
+BreakBeforeBinaryOperators: All
+BreakBeforeBraces: GNU
+ColumnLimit: 80
+ContinuationIndentWidth: 2
+ForEachMacros: [FOR_EACH_TAIL, FOR_EACH_TAIL_SAFE]
+IncludeCategories:
+ - Regex: '^<config\.h>$'
+ Priority: -1
+ - Regex: '^<'
+ Priority: 1
+ - Regex: '^"lisp\.h"$'
+ Priority: 2
+ - Regex: '.*'
+ Priority: 3
+KeepEmptyLinesAtTheStartOfBlocks: false
+MaxEmptyLinesToKeep: 1
+PenaltyBreakBeforeFirstCallParameter: 2000
+SpaceAfterCStyleCast: true
+SpaceBeforeParens: Always
+
+# Local Variables:
+# mode: yaml
+# End: