Add separate .clang-format files for headers
This commit is contained in:
61
.clang-format.headers
Normal file
61
.clang-format.headers
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
BasedOnStyle: LLVM
|
||||||
|
IndentWidth: 8
|
||||||
|
UseTab: Always
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BraceWrapping:
|
||||||
|
AfterClass: false
|
||||||
|
AfterEnum: false
|
||||||
|
AfterStruct: false
|
||||||
|
AfterUnion: false
|
||||||
|
AfterControlStatement: MultiLine
|
||||||
|
AfterFunction: false # should also be MultiLine, but not yet supported
|
||||||
|
AfterExternBlock: false
|
||||||
|
BeforeElse: false
|
||||||
|
IndentBraces: false
|
||||||
|
SplitEmptyFunction: true
|
||||||
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
IndentCaseLabels: false
|
||||||
|
AlwaysBreakAfterReturnType: All
|
||||||
|
Cpp11BracedListStyle: false
|
||||||
|
ColumnLimit: 80
|
||||||
|
AlignAfterOpenBracket: Align
|
||||||
|
AlignConsecutiveDeclarations: true
|
||||||
|
AlignConsecutiveMacros: true
|
||||||
|
AlignTrailingComments: true
|
||||||
|
AllowAllArgumentsOnNextLine: true
|
||||||
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
PointerAlignment: Right
|
||||||
|
PointerBindsToType: false
|
||||||
|
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
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
PenaltyBreakAssignment: 30
|
||||||
|
PenaltyBreakComment: 10
|
||||||
|
PenaltyBreakFirstLessLess: 0
|
||||||
|
PenaltyBreakString: 10
|
||||||
|
PenaltyExcessCharacter: 100
|
||||||
|
Standard: Cpp11
|
||||||
|
ContinuationIndentWidth: 8
|
||||||
@@ -389,7 +389,7 @@ misc:sid:amd64:
|
|||||||
💾:sid:amd64:
|
💾:sid:amd64:
|
||||||
<<: *precheck_job
|
<<: *precheck_job
|
||||||
script:
|
script:
|
||||||
- if [ -r .clang-format ]; then ./util/cformat.sh "${CLANG_FORMAT}"; fi
|
- if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi
|
||||||
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
|
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
|
||||||
|
|
||||||
🐞:sid:amd64:
|
🐞:sid:amd64:
|
||||||
|
|||||||
1
bin/confgen/include/.clang-format
Symbolic link
1
bin/confgen/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
bin/dig/include/.clang-format
Symbolic link
1
bin/dig/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
bin/named/include/.clang-format
Symbolic link
1
bin/named/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
bin/named/unix/include/.clang-format
Symbolic link
1
bin/named/unix/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
bin/named/win32/include/.clang-format
Symbolic link
1
bin/named/win32/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
bin/rndc/include/.clang-format
Symbolic link
1
bin/rndc/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
contrib/dlz/drivers/include/.clang-format
Symbolic link
1
contrib/dlz/drivers/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
contrib/dlz/modules/include/.clang-format
Symbolic link
1
contrib/dlz/modules/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/bind9/include/.clang-format
Symbolic link
1
lib/bind9/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/dns/include/.clang-format
Symbolic link
1
lib/dns/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/irs/include/.clang-format
Symbolic link
1
lib/irs/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/irs/win32/include/.clang-format
Symbolic link
1
lib/irs/win32/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/isc/include/.clang-format
Symbolic link
1
lib/isc/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/isc/pthreads/include/.clang-format
Symbolic link
1
lib/isc/pthreads/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/isc/unix/include/.clang-format
Symbolic link
1
lib/isc/unix/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/isc/win32/include/.clang-format
Symbolic link
1
lib/isc/win32/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/isccc/include/.clang-format
Symbolic link
1
lib/isccc/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/isccfg/include/.clang-format
Symbolic link
1
lib/isccfg/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
1
lib/ns/include/.clang-format
Symbolic link
1
lib/ns/include/.clang-format
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../.clang-format.headers
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
||||||
#
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
#
|
|
||||||
# See the COPYRIGHT file distributed with this work for additional
|
|
||||||
# information regarding copyright ownership.
|
|
||||||
|
|
||||||
CLANG_FORMAT=clang-format
|
|
||||||
if [ -n "$1" ]; then
|
|
||||||
CLANG_FORMAT="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
CLANG_FORMAT_VERSION=$("$CLANG_FORMAT" --version | sed -e 's/clang-format version \([0-9]*\)\..*/\1/')
|
|
||||||
|
|
||||||
if [ "$CLANG_FORMAT_VERSION" -lt 11 ]; then
|
|
||||||
echo "clang-format version 11 required"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# use the main .clang-format for C files
|
|
||||||
"$CLANG_FORMAT" --style=file --sort-includes -i $(git ls-files '*.c')
|
|
||||||
|
|
||||||
# set up a temporary .clang-format file for headers ONLY
|
|
||||||
cp -f .clang-format .clang-format.bak
|
|
||||||
sed -e 's/\(AlignConsecutiveDeclarations\).*/\1: true/' \
|
|
||||||
.clang-format.bak > .clang-format
|
|
||||||
|
|
||||||
"$CLANG_FORMAT" --style=file --sort-includes -i $(git ls-files '*.h')
|
|
||||||
|
|
||||||
# restore the original .clang-format file
|
|
||||||
cp -f .clang-format.bak .clang-format
|
|
||||||
rm -f .clang-format.bak
|
|
||||||
Reference in New Issue
Block a user