[Dnsmasq-discuss] [PATCH 3/3] Tuned .clang-format for us

Geert Stappers stappers at stappers.nl
Sun Oct 13 23:24:48 BST 2019


From: Geert Stappers <stappers at stappers.nl>

the C coding style in dnsmasq is the GNU style,
except without the space preceding (
---
 src/.clang-format | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/.clang-format b/src/.clang-format
index 08f7020..9acbeb6 100644
--- a/src/.clang-format
+++ b/src/.clang-format
@@ -1,4 +1,5 @@
 # Copyright (C) 2015 Free Software Foundation, Inc.
+# Copyright (C) 2019 Dnsmasq mailinglist
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -13,6 +14,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# the C coding style in dnsmasq is the GNU style,
+# except without the space preceding (
+
 # clang-format 7.0.1 is required
 #
 # To utilize the tool to lines just touched by a patch, use
@@ -23,11 +27,14 @@
 # (here the tool will generate a patch)
 # git diff -U0 --no-color | clang-format-diff -p1 -i
 # (modifications are applied)
+#
+# See also
+# https://releases.llvm.org/8.0.0/tools/clang/docs/ClangFormatStyleOptions.html
 
 ---
 Language: Cpp
 AccessModifierOffset: -2
-AlwaysBreakAfterReturnType: TopLevel
+AlwaysBreakAfterReturnType: None
 BinPackArguments: true
 BinPackParameters: true
 BraceWrapping:
@@ -53,10 +60,11 @@ ForEachMacros: [ ]
 IndentCaseLabels: false
 NamespaceIndentation: None
 PenaltyBreakBeforeFirstCallParameter: 100
+PenaltyReturnTypeOnItsOwnLine: 100
 PointerAlignment: Right
 SortIncludes: false
-SpaceAfterCStyleCast: true
-SpaceBeforeParens: Always
+SpaceAfterCStyleCast: false
+SpaceBeforeParens: ControlStatements
 SpacesBeforeTrailingComments: 1
 UseTab: Always
 AlignEscapedNewlines: Right
-- 
2.1.4




More information about the Dnsmasq-discuss mailing list