aboutsummaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorDavid Turner <david.turner.dev@gmail.com>2020-05-01 15:37:56 +0200
committerWerner Lemberg <wl@gnu.org>2020-07-16 15:51:06 +0200
commitee19a6cbbcb28e7aab04dd13918edd46f21ecb22 (patch)
tree215d6223ae93e1cf20e864f6b6ba5f0a89c2016e /.clang-format
parentb7c467b6efa5a91945854de81632be45d6f360ff (diff)
downloadfreetype-ee19a6cbbcb28e7aab04dd13918edd46f21ecb22.tar.gz
Add .clang-format file
This file can be used to reformat FreeType sources and commits using one of these methods: - Direct formatting of a whole file: clang-format -i path/to/file For example, to reformat all sources at once: echo builds/unix/ftconfig.h.in $(git ls-files *.[hc]) | xargs clang-format -i - Only reformat the changed lines in the current work directoy: git clang-format The style settings in this file are very close to the FreeType formatting style, with the following exceptions which are not supported here: - Mminimal 2-space margin on each non-empty line. (no left margin instead). - 2 empty lines between variable declarations and statements in C blocks. (only 1 is kept). { int x = ...; foo(x); } becomes { int x = ...; foo(x); } - Aignment of declarations uses 2 spaces to separate types and variable names (only 1 space is kept). int x; => int x; int y; int y; - The start used for output parameters in function signature should be near the variable name (always near the type). void foo(int* input_ptr, int *output_ptr) => void foo(int* input_ptr, int* output_ptr)
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format16
1 files changed, 16 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 000000000..fbd04c11c
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,16 @@
+BasedOnStyle: Chromium
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: true
+AlignConsecutiveMacros: true
+AlignEscapedNewlines: true
+# AlignOperands: Align
+AlignTrailingComments: true
+AlwaysBreakAfterReturnType: AllDefinitions
+BreakBeforeBraces: Allman
+ColumnLimit: 80
+DerivePointerAlignment: false
+IndentCaseLabels: false
+PointerAlignment: Left
+SpaceBeforeParens: ControlStatements
+SpacesInParentheses: true