Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 2020 11:54:00 +0000 (UTC)
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367100 - head
Message-ID:  <202010281154.09SBs07N097228@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arichardson
Date: Wed Oct 28 11:54:00 2020
New Revision: 367100
URL: https://svnweb.freebsd.org/changeset/base/367100

Log:
  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

Modified:
  head/.clang-format   (contents, props changed)

Modified: head/.clang-format
==============================================================================
--- head/.clang-format	Wed Oct 28 11:53:55 2020	(r367099)
+++ head/.clang-format	Wed Oct 28 11:54:00 2020	(r367100)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010281154.09SBs07N097228>