]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Import Linux kernel .clang-format with small modifications
authorOndřej Surý <ondrej@sury.org>
Tue, 16 Jul 2019 20:23:06 +0000 (22:23 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 12 Feb 2020 13:01:08 +0000 (14:01 +0100)
.clang-format [new file with mode: 0644]
util/copyrights
util/update_copyrights

diff --git a/.clang-format b/.clang-format
new file mode 100644 (file)
index 0000000..7e2dbc5
--- /dev/null
@@ -0,0 +1,50 @@
+BasedOnStyle: LLVM
+IndentWidth: 8
+UseTab: Always
+BreakBeforeBraces: Linux
+AllowShortIfStatementsOnASingleLine: false
+IndentCaseLabels: false
+AlwaysBreakAfterReturnType: All
+Cpp11BracedListStyle: false
+ColumnLimit: 80
+AlignAfterOpenBracket: Align
+AlignConsecutiveDeclarations: true
+AlwaysBreakBeforeMultilineStrings: false
+BreakBeforeBinaryOperators: None
+BreakBeforeTernaryOperators: true
+AlignEscapedNewlines: Left
+DerivePointerAlignment: false
+PointerAlignment: Right
+IncludeBlocks: Regroup
+IncludeCategories:
+  - Regex:           '^<isc/'
+    Priority:        2
+  - Regex:           '^<dns/'
+    Priority:        3
+  - Regex:           '^<iscccc/'
+    Priority:        4
+  - Regex:           '^<isccfg/'
+    Priority:        5
+  - Regex:           '^<ns/'
+    Priority:        6
+  - Regex:           '^<bind9/)'
+    Priority:        7
+  - Regex:           '^(<[^/]*)/)'
+    Priority:        8
+  - Regex:           '<[[:alnum:].]+>'
+    Priority:        1
+  - Regex:           '".*"'
+    Priority:        9
+KeepEmptyLinesAtTheStartOfBlocks: false
+
+# Taken from git's rules
+PenaltyBreakAssignment: 10
+# PenaltyBreakBeforeFirstCallParameter: 30
+PenaltyBreakComment: 10
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakString: 10
+PenaltyExcessCharacter: 100
+
+Standard: Cpp11
+
+ContinuationIndentWidth: 8
index bc7ffbd33f9f58e3b3c50651f90d226814b90516..9ac4f64dd0ae047d7c86002ba7ce42d9e5f19064 100644 (file)
@@ -1,3 +1,4 @@
+./.clang-format                                        X       2019,2020
 ./.gitlab-ci.yml                               X       2018,2019,2020
 ./.uncrustify.cfg                              X       2018,2019,2020
 ./CHANGES                                      X       2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020
index fd86d0026bcd3f59fc2587cc44f3fd487cc04b18..5ba9209876a5003bbd775dbd15aaa537f774effa 100644 (file)
@@ -521,10 +521,10 @@ foreach $file (keys %file_types) {
                        # Process leading white space.
                        # Remove 1-7 spaces followed by a tab into a single
                        # tab if at start of line or proceeded by tabs.
-                       s/^(\t*) {1,7}\t/$1\t/ while (/^\t* {1,7}\t/);
+                       s/^(\t*) {1,7}\t/$1\t/ while (/^\t* {1,7}\t/);
                        # Convert 8 spaces into tabs if at start of line
                        # or preceeded by tabs.
-                       s/^(\t*) {8}/$1\t/ while (/^\t* {8}/);
+                       s/^(\t*) {8}/$1\t/ while (/^\t* {8}/);
                        # Remove trailing white space.
                        s/[ \t]*$//;
                                $body = "$body$_";