[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] master ee19a6c 1/2: Add .clang-format file
From: |
Werner LEMBERG |
Subject: |
[freetype2] master ee19a6c 1/2: Add .clang-format file |
Date: |
Thu, 23 Jul 2020 07:03:50 -0400 (EDT) |
branch: master
commit ee19a6cbbcb28e7aab04dd13918edd46f21ecb22
Author: David Turner <david.turner.dev@gmail.com>
Commit: Werner Lemberg <wl@gnu.org>
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)
---
.clang-format | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..fbd04c1
--- /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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] master ee19a6c 1/2: Add .clang-format file,
Werner LEMBERG <=