summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2020-10-28 11:54:00 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2020-10-28 11:54:00 +0000
commit71167bd597130dbd6fd0aea749616d9293875489 (patch)
tree6cdeae425e3c5bb9ba5068b88d6a9fcbbdf6a945 /.clang-format
parent453d775b3404cc3dcf53d8584ee1f813d54f40be (diff)
downloadsrc-test-71167bd597130dbd6fd0aea749616d9293875489.tar.gz
src-test-71167bd597130dbd6fd0aea749616d9293875489.zip
clang-format: Avoid breaking after the opening paren of function definitions
This depends on https://reviews.llvm.org/D90246 to have any effect, but once that has landed clang-format will no longer format code like this: ``` int myfunction( int param1, int param2, int param2) { ... } ``` and instead create the following: ``` int myfunction(int param1, int param2, int param2) { ... } ``` Reviewed By: emaste, cem Differential Revision: https://reviews.freebsd.org/D26978
Notes
Notes: svn path=/head/; revision=367100
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format16
1 files changed, 15 insertions, 1 deletions
diff --git a/.clang-format b/.clang-format
index 867e738f005f3..06709b762ec12 100644
--- a/.clang-format
+++ b/.clang-format
@@ -8,6 +8,7 @@ AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: false
AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
@@ -24,7 +25,20 @@ BreakBeforeBraces: WebKit
BreakBeforeTernaryOperators: false
# TODO: BreakStringLiterals can cause very strange formatting so turn it off?
BreakStringLiterals: false
-PenaltyBreakBeforeFirstCallParameter: 1000
+# Prefer:
+# some_var = function(arg1,
+# arg2)
+# over:
+# some_var =
+# function(arg1, arg2)
+PenaltyBreakAssignment: 100
+# Prefer:
+# some_long_function(arg1, arg2
+# arg3)
+# over:
+# some_long_function(
+# arg1, arg2, arg3)
+PenaltyBreakBeforeFirstCallParameter: 100
CompactNamespaces: true
DerivePointerAlignment: false
DisableFormat: false